mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
comments
This commit is contained in:
parent
5cbc928c30
commit
4156b085f6
3
v3.go
3
v3.go
@ -81,6 +81,9 @@ func Setup(destHomeserver, postgresURI, secret string, opts Opts) (*handler2.Han
|
||||
storev2 := sync2.NewStore(postgresURI, secret)
|
||||
for _, db := range []*sqlx.DB{store.DB, storev2.DB} {
|
||||
if opts.DBMaxConns > 0 {
|
||||
// https://github.com/go-sql-driver/mysql#important-settings
|
||||
// "db.SetMaxIdleConns() is recommended to be set same to db.SetMaxOpenConns(). When it is smaller
|
||||
// than SetMaxOpenConns(), connections can be opened and closed much more frequently than you expect."
|
||||
db.SetMaxOpenConns(opts.DBMaxConns)
|
||||
db.SetMaxIdleConns(opts.DBMaxConns)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user