0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-12-15 03:43:43 +01:00

Fix bug in database global setup

This commit is contained in:
Neil Alexander 2022-05-03 17:40:56 +01:00
parent e01d1e1f5b
commit b0a9e85c4a
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -201,7 +201,8 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, options ...Base
if cfg.Global.DatabaseOptions.ConnectionString.IsSQLite() { if cfg.Global.DatabaseOptions.ConnectionString.IsSQLite() {
logrus.Panic("Using a global database connection pool is not supported with SQLite databases") logrus.Panic("Using a global database connection pool is not supported with SQLite databases")
} }
if db, err = sqlutil.Open(&cfg.Global.DatabaseOptions, sqlutil.NewDummyWriter()); err != nil { writer = sqlutil.NewDummyWriter()
if db, err = sqlutil.Open(&cfg.Global.DatabaseOptions, writer); err != nil {
logrus.WithError(err).Panic("Failed to set up global database connections") logrus.WithError(err).Panic("Failed to set up global database connections")
} }
logrus.Debug("Using global database connection pool") logrus.Debug("Using global database connection pool")