diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2021-03-08 13:18:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-08 13:18:29 +0000 |
commit | c3ad2cca49a7ad5890dddf2d8eec3e3cbbff16d1 (patch) | |
tree | 62d5ba17ef8a2a3a4ebd34f9593faa7c559ffedc /setup/config | |
parent | 6aa262ead804529f9e328302b0c2e2653ffffd09 (diff) |
Fix database default connection limits for CI (#1794)
Diffstat (limited to 'setup/config')
-rw-r--r-- | setup/config/config_appservice.go | 2 | ||||
-rw-r--r-- | setup/config/config_federationsender.go | 2 | ||||
-rw-r--r-- | setup/config/config_global.go | 4 | ||||
-rw-r--r-- | setup/config/config_kafka.go | 2 | ||||
-rw-r--r-- | setup/config/config_keyserver.go | 2 | ||||
-rw-r--r-- | setup/config/config_mediaapi.go | 2 | ||||
-rw-r--r-- | setup/config/config_mscs.go | 2 | ||||
-rw-r--r-- | setup/config/config_roomserver.go | 2 | ||||
-rw-r--r-- | setup/config/config_signingkeyserver.go | 2 | ||||
-rw-r--r-- | setup/config/config_syncapi.go | 2 | ||||
-rw-r--r-- | setup/config/config_userapi.go | 4 |
11 files changed, 13 insertions, 13 deletions
diff --git a/setup/config/config_appservice.go b/setup/config/config_appservice.go index 724f035f..57cc7be5 100644 --- a/setup/config/config_appservice.go +++ b/setup/config/config_appservice.go @@ -43,7 +43,7 @@ type AppServiceAPI struct { func (c *AppServiceAPI) Defaults() { c.InternalAPI.Listen = "http://localhost:7777" c.InternalAPI.Connect = "http://localhost:7777" - c.Database.Defaults() + c.Database.Defaults(10) c.Database.ConnectionString = "file:appservice.db" } diff --git a/setup/config/config_federationsender.go b/setup/config/config_federationsender.go index 84f5b6f4..67ee6356 100644 --- a/setup/config/config_federationsender.go +++ b/setup/config/config_federationsender.go @@ -25,7 +25,7 @@ type FederationSender struct { func (c *FederationSender) Defaults() { c.InternalAPI.Listen = "http://localhost:7775" c.InternalAPI.Connect = "http://localhost:7775" - c.Database.Defaults() + c.Database.Defaults(10) c.Database.ConnectionString = "file:federationsender.db" c.FederationMaxRetries = 16 diff --git a/setup/config/config_global.go b/setup/config/config_global.go index d4b068db..4b5297ff 100644 --- a/setup/config/config_global.go +++ b/setup/config/config_global.go @@ -122,8 +122,8 @@ type DatabaseOptions struct { ConnMaxLifetimeSeconds int `yaml:"conn_max_lifetime"` } -func (c *DatabaseOptions) Defaults() { - c.MaxOpenConnections = 100 +func (c *DatabaseOptions) Defaults(conns int) { + c.MaxOpenConnections = conns c.MaxIdleConnections = 2 c.ConnMaxLifetimeSeconds = -1 } diff --git a/setup/config/config_kafka.go b/setup/config/config_kafka.go index aa91e558..36191428 100644 --- a/setup/config/config_kafka.go +++ b/setup/config/config_kafka.go @@ -36,7 +36,7 @@ func (k *Kafka) TopicFor(name string) string { func (c *Kafka) Defaults() { c.UseNaffka = true - c.Database.Defaults() + c.Database.Defaults(10) c.Addresses = []string{"localhost:2181"} c.Database.ConnectionString = DataSource("file:naffka.db") c.TopicPrefix = "Dendrite" diff --git a/setup/config/config_keyserver.go b/setup/config/config_keyserver.go index 89162300..62a30dbb 100644 --- a/setup/config/config_keyserver.go +++ b/setup/config/config_keyserver.go @@ -11,7 +11,7 @@ type KeyServer struct { func (c *KeyServer) Defaults() { c.InternalAPI.Listen = "http://localhost:7779" c.InternalAPI.Connect = "http://localhost:7779" - c.Database.Defaults() + c.Database.Defaults(10) c.Database.ConnectionString = "file:keyserver.db" } diff --git a/setup/config/config_mediaapi.go b/setup/config/config_mediaapi.go index a9425b7b..660a508d 100644 --- a/setup/config/config_mediaapi.go +++ b/setup/config/config_mediaapi.go @@ -39,7 +39,7 @@ func (c *MediaAPI) Defaults() { c.InternalAPI.Listen = "http://localhost:7774" c.InternalAPI.Connect = "http://localhost:7774" c.ExternalAPI.Listen = "http://[::]:8074" - c.Database.Defaults() + c.Database.Defaults(5) c.Database.ConnectionString = "file:mediaapi.db" defaultMaxFileSizeBytes := FileSizeBytes(10485760) diff --git a/setup/config/config_mscs.go b/setup/config/config_mscs.go index 764273ec..a94e5dc5 100644 --- a/setup/config/config_mscs.go +++ b/setup/config/config_mscs.go @@ -14,7 +14,7 @@ type MSCs struct { } func (c *MSCs) Defaults() { - c.Database.Defaults() + c.Database.Defaults(5) c.Database.ConnectionString = "file:mscs.db" } diff --git a/setup/config/config_roomserver.go b/setup/config/config_roomserver.go index 2a1fc38b..ffb9b5f9 100644 --- a/setup/config/config_roomserver.go +++ b/setup/config/config_roomserver.go @@ -11,7 +11,7 @@ type RoomServer struct { func (c *RoomServer) Defaults() { c.InternalAPI.Listen = "http://localhost:7770" c.InternalAPI.Connect = "http://localhost:7770" - c.Database.Defaults() + c.Database.Defaults(10) c.Database.ConnectionString = "file:roomserver.db" } diff --git a/setup/config/config_signingkeyserver.go b/setup/config/config_signingkeyserver.go index 51aca38b..c192d1fc 100644 --- a/setup/config/config_signingkeyserver.go +++ b/setup/config/config_signingkeyserver.go @@ -22,7 +22,7 @@ type SigningKeyServer struct { func (c *SigningKeyServer) Defaults() { c.InternalAPI.Listen = "http://localhost:7780" c.InternalAPI.Connect = "http://localhost:7780" - c.Database.Defaults() + c.Database.Defaults(10) c.Database.ConnectionString = "file:signingkeyserver.db" } diff --git a/setup/config/config_syncapi.go b/setup/config/config_syncapi.go index fc08f738..4b9bfb16 100644 --- a/setup/config/config_syncapi.go +++ b/setup/config/config_syncapi.go @@ -15,7 +15,7 @@ func (c *SyncAPI) Defaults() { c.InternalAPI.Listen = "http://localhost:7773" c.InternalAPI.Connect = "http://localhost:7773" c.ExternalAPI.Listen = "http://localhost:8073" - c.Database.Defaults() + c.Database.Defaults(10) c.Database.ConnectionString = "file:syncapi.db" } diff --git a/setup/config/config_userapi.go b/setup/config/config_userapi.go index 2cbd8a45..91b351d1 100644 --- a/setup/config/config_userapi.go +++ b/setup/config/config_userapi.go @@ -16,8 +16,8 @@ type UserAPI struct { func (c *UserAPI) Defaults() { c.InternalAPI.Listen = "http://localhost:7781" c.InternalAPI.Connect = "http://localhost:7781" - c.AccountDatabase.Defaults() - c.DeviceDatabase.Defaults() + c.AccountDatabase.Defaults(10) + c.DeviceDatabase.Defaults(10) c.AccountDatabase.ConnectionString = "file:userapi_accounts.db" c.DeviceDatabase.ConnectionString = "file:userapi_devices.db" } |