aboutsummaryrefslogtreecommitdiff
path: root/federationapi
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2023-07-19 13:37:04 +0200
committerGitHub <noreply@github.com>2023-07-19 13:37:04 +0200
commit297479ea4993f00a60600232485275d2c57462fe (patch)
tree35670b8efeebcaf4caf1d482d8183c2d1fc7e6f7 /federationapi
parenta01faee17c331db76317a38dd28c1ae85e5ed1f6 (diff)
Use pointer when passing the connection manager around (#3152)
As otherwise existing connections aren't reused.
Diffstat (limited to 'federationapi')
-rw-r--r--federationapi/federationapi.go2
-rw-r--r--federationapi/storage/postgres/storage.go2
-rw-r--r--federationapi/storage/sqlite3/storage.go2
-rw-r--r--federationapi/storage/storage.go2
4 files changed, 4 insertions, 4 deletions
diff --git a/federationapi/federationapi.go b/federationapi/federationapi.go
index ee15a8a6..e148199f 100644
--- a/federationapi/federationapi.go
+++ b/federationapi/federationapi.go
@@ -95,7 +95,7 @@ func AddPublicRoutes(
func NewInternalAPI(
processContext *process.ProcessContext,
dendriteCfg *config.Dendrite,
- cm sqlutil.Connections,
+ cm *sqlutil.Connections,
natsInstance *jetstream.NATSInstance,
federation fclient.FederationClient,
rsAPI roomserverAPI.FederationRoomserverAPI,
diff --git a/federationapi/storage/postgres/storage.go b/federationapi/storage/postgres/storage.go
index 30665bc5..2caa7a05 100644
--- a/federationapi/storage/postgres/storage.go
+++ b/federationapi/storage/postgres/storage.go
@@ -36,7 +36,7 @@ type Database struct {
}
// NewDatabase opens a new database
-func NewDatabase(ctx context.Context, conMan sqlutil.Connections, dbProperties *config.DatabaseOptions, cache caching.FederationCache, isLocalServerName func(spec.ServerName) bool) (*Database, error) {
+func NewDatabase(ctx context.Context, conMan *sqlutil.Connections, dbProperties *config.DatabaseOptions, cache caching.FederationCache, isLocalServerName func(spec.ServerName) bool) (*Database, error) {
var d Database
var err error
if d.db, d.writer, err = conMan.Connection(dbProperties); err != nil {
diff --git a/federationapi/storage/sqlite3/storage.go b/federationapi/storage/sqlite3/storage.go
index 00c8afa0..524bf1d5 100644
--- a/federationapi/storage/sqlite3/storage.go
+++ b/federationapi/storage/sqlite3/storage.go
@@ -34,7 +34,7 @@ type Database struct {
}
// NewDatabase opens a new database
-func NewDatabase(ctx context.Context, conMan sqlutil.Connections, dbProperties *config.DatabaseOptions, cache caching.FederationCache, isLocalServerName func(spec.ServerName) bool) (*Database, error) {
+func NewDatabase(ctx context.Context, conMan *sqlutil.Connections, dbProperties *config.DatabaseOptions, cache caching.FederationCache, isLocalServerName func(spec.ServerName) bool) (*Database, error) {
var d Database
var err error
if d.db, d.writer, err = conMan.Connection(dbProperties); err != nil {
diff --git a/federationapi/storage/storage.go b/federationapi/storage/storage.go
index 322a6c75..f926b62e 100644
--- a/federationapi/storage/storage.go
+++ b/federationapi/storage/storage.go
@@ -30,7 +30,7 @@ import (
)
// NewDatabase opens a new database
-func NewDatabase(ctx context.Context, conMan sqlutil.Connections, dbProperties *config.DatabaseOptions, cache caching.FederationCache, isLocalServerName func(spec.ServerName) bool) (Database, error) {
+func NewDatabase(ctx context.Context, conMan *sqlutil.Connections, dbProperties *config.DatabaseOptions, cache caching.FederationCache, isLocalServerName func(spec.ServerName) bool) (Database, error) {
switch {
case dbProperties.ConnectionString.IsSQLite():
return sqlite3.NewDatabase(ctx, conMan, dbProperties, cache, isLocalServerName)