aboutsummaryrefslogtreecommitdiff
path: root/syncapi
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 /syncapi
parenta01faee17c331db76317a38dd28c1ae85e5ed1f6 (diff)
Use pointer when passing the connection manager around (#3152)
As otherwise existing connections aren't reused.
Diffstat (limited to 'syncapi')
-rw-r--r--syncapi/storage/postgres/syncserver.go2
-rw-r--r--syncapi/storage/sqlite3/syncserver.go2
-rw-r--r--syncapi/storage/storage.go2
-rw-r--r--syncapi/syncapi.go2
4 files changed, 4 insertions, 4 deletions
diff --git a/syncapi/storage/postgres/syncserver.go b/syncapi/storage/postgres/syncserver.go
index 9f9de28d..2105bcae 100644
--- a/syncapi/storage/postgres/syncserver.go
+++ b/syncapi/storage/postgres/syncserver.go
@@ -36,7 +36,7 @@ type SyncServerDatasource struct {
}
// NewDatabase creates a new sync server database
-func NewDatabase(ctx context.Context, cm sqlutil.Connections, dbProperties *config.DatabaseOptions) (*SyncServerDatasource, error) {
+func NewDatabase(ctx context.Context, cm *sqlutil.Connections, dbProperties *config.DatabaseOptions) (*SyncServerDatasource, error) {
var d SyncServerDatasource
var err error
if d.db, d.writer, err = cm.Connection(dbProperties); err != nil {
diff --git a/syncapi/storage/sqlite3/syncserver.go b/syncapi/storage/sqlite3/syncserver.go
index 3f1ca355..e1372f10 100644
--- a/syncapi/storage/sqlite3/syncserver.go
+++ b/syncapi/storage/sqlite3/syncserver.go
@@ -36,7 +36,7 @@ type SyncServerDatasource struct {
// NewDatabase creates a new sync server database
// nolint: gocyclo
-func NewDatabase(ctx context.Context, conMan sqlutil.Connections, dbProperties *config.DatabaseOptions) (*SyncServerDatasource, error) {
+func NewDatabase(ctx context.Context, conMan *sqlutil.Connections, dbProperties *config.DatabaseOptions) (*SyncServerDatasource, error) {
var d SyncServerDatasource
var err error
diff --git a/syncapi/storage/storage.go b/syncapi/storage/storage.go
index 8714ec5e..e05f9d91 100644
--- a/syncapi/storage/storage.go
+++ b/syncapi/storage/storage.go
@@ -28,7 +28,7 @@ import (
)
// NewSyncServerDatasource opens a database connection.
-func NewSyncServerDatasource(ctx context.Context, conMan sqlutil.Connections, dbProperties *config.DatabaseOptions) (Database, error) {
+func NewSyncServerDatasource(ctx context.Context, conMan *sqlutil.Connections, dbProperties *config.DatabaseOptions) (Database, error) {
switch {
case dbProperties.ConnectionString.IsSQLite():
return sqlite3.NewDatabase(ctx, conMan, dbProperties)
diff --git a/syncapi/syncapi.go b/syncapi/syncapi.go
index af6bddc7..091e3db4 100644
--- a/syncapi/syncapi.go
+++ b/syncapi/syncapi.go
@@ -45,7 +45,7 @@ func AddPublicRoutes(
processContext *process.ProcessContext,
routers httputil.Routers,
dendriteCfg *config.Dendrite,
- cm sqlutil.Connections,
+ cm *sqlutil.Connections,
natsInstance *jetstream.NATSInstance,
userAPI userapi.SyncUserAPI,
rsAPI api.SyncRoomserverAPI,