mirror of
https://github.com/spacebarchat/server.git
synced 2026-11-28 18:58:31 +00:00
Expose some database pooling options
This commit is contained in:
1 parent
ba7c46c057
commit
2cc2adcb44
1 file changed
+7
@@ -69,6 +69,13 @@ export const DataSourceOptions = isHeadlessProcess
|
||||
undefined: "ignore",
|
||||
},
|
||||
connectTimeoutMS: 10000,
|
||||
poolSize: process.env.DB_POOL_SIZE ? Number(process.env.DB_POOL_SIZE) : 10,
|
||||
extra: {
|
||||
min: process.env.DB_POOL_SIZE_MIN ? Number(process.env.DB_POOL_SIZE_MIN) : 0,
|
||||
// redundant but for good measure:
|
||||
max: process.env.DB_POOL_SIZE ? Number(process.env.DB_POOL_SIZE) : 10,
|
||||
idleTimeoutMillis: process.env.DB_IDLE_TIMEOUT_MS ? Number(process.env.DB_IDLE_TIMEOUT_MS) : 10000,
|
||||
},
|
||||
} satisfies PostgresDataSourceOptions);
|
||||
|
||||
// Gets the existing database connection
|
||||
|
||||
Reference in new issue
Block a user