diff --git a/syncapi/storage/postgres/syncserver.go b/syncapi/storage/postgres/syncserver.go index cacf2057a..60fe5b54d 100644 --- a/syncapi/storage/postgres/syncserver.go +++ b/syncapi/storage/postgres/syncserver.go @@ -37,7 +37,7 @@ type SyncServerDatasource struct { // NewDatabase creates a new sync server database func NewDatabase(dbProperties *config.DatabaseOptions) (*SyncServerDatasource, error) { - d := SyncServerDatasource{} + var d SyncServerDatasource var err error if d.db, err = sqlutil.Open(dbProperties); err != nil { return nil, err diff --git a/syncapi/storage/storage.go b/syncapi/storage/storage.go index b656d3266..7f9c28e9d 100644 --- a/syncapi/storage/storage.go +++ b/syncapi/storage/storage.go @@ -23,11 +23,10 @@ import ( "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage/postgres" "github.com/matrix-org/dendrite/syncapi/storage/sqlite3" - "github.com/matrix-org/gomatrixserverlib" ) // NewSyncServerDatasource opens a database connection. -func NewSyncServerDatasource(dbProperties *config.DatabaseOptions, serverName gomatrixserverlib.ServerName) (Database, error) { +func NewSyncServerDatasource(dbProperties *config.DatabaseOptions) (Database, error) { switch { case dbProperties.ConnectionString.IsSQLite(): return sqlite3.NewDatabase(dbProperties) diff --git a/syncapi/storage/storage_wasm.go b/syncapi/storage/storage_wasm.go index c2d9d2ed0..f7fef962b 100644 --- a/syncapi/storage/storage_wasm.go +++ b/syncapi/storage/storage_wasm.go @@ -19,11 +19,10 @@ import ( "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage/sqlite3" - "github.com/matrix-org/gomatrixserverlib" ) // NewPublicRoomsServerDatabase opens a database connection. -func NewSyncServerDatasource(dbProperties *config.DatabaseOptions, serverName gomatrixserverlib.ServerName) (Database, error) { +func NewSyncServerDatasource(dbProperties *config.DatabaseOptions) (Database, error) { switch { case dbProperties.ConnectionString.IsSQLite(): return sqlite3.NewDatabase(dbProperties) diff --git a/syncapi/syncapi.go b/syncapi/syncapi.go index 10032a54d..cb9890ff7 100644 --- a/syncapi/syncapi.go +++ b/syncapi/syncapi.go @@ -51,7 +51,7 @@ func AddPublicRoutes( ) { js := jetstream.Prepare(&cfg.Matrix.JetStream) - syncDB, err := storage.NewSyncServerDatasource(&cfg.Database, cfg.Matrix.ServerName) + syncDB, err := storage.NewSyncServerDatasource(&cfg.Database) if err != nil { logrus.WithError(err).Panicf("failed to connect to sync db") } @@ -133,4 +133,3 @@ func AddPublicRoutes( routing.Setup(router, requestPool, syncDB, userAPI, federation, rsAPI, cfg) } -