feat(core): Make Postgres connection timeout configurable (#10670)
This commit is contained in:
@@ -75,6 +75,10 @@ class PostgresConfig {
|
||||
@Env('DB_POSTGRESDB_POOL_SIZE')
|
||||
poolSize: number = 2;
|
||||
|
||||
/** Postgres connection timeout (ms) */
|
||||
@Env('DB_POSTGRESDB_CONNECTION_TIMEOUT')
|
||||
connectionTimeoutMs: number = 1000;
|
||||
|
||||
@Nested
|
||||
ssl: PostgresSSLConfig;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ describe('GlobalConfig', () => {
|
||||
poolSize: 2,
|
||||
port: 5432,
|
||||
schema: 'public',
|
||||
connectionTimeoutMs: 1000,
|
||||
ssl: {
|
||||
ca: '',
|
||||
cert: '',
|
||||
|
||||
@@ -104,6 +104,7 @@ const getPostgresConnectionOptions = (): PostgresConnectionOptions => {
|
||||
schema: postgresConfig.schema,
|
||||
poolSize: postgresConfig.poolSize,
|
||||
migrations: postgresMigrations,
|
||||
connectTimeoutMS: postgresConfig.connectionTimeoutMs,
|
||||
ssl,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user