feat(core): Make Postgres connection timeout configurable (#10670)

This commit is contained in:
Iván Ovejero 2024-09-05 09:31:08 +02:00 committed by GitHub
parent e318a6323a
commit 81540318b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 0 deletions

View file

@ -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;
}

View file

@ -47,6 +47,7 @@ describe('GlobalConfig', () => {
poolSize: 2,
port: 5432,
schema: 'public',
connectionTimeoutMs: 1000,
ssl: {
ca: '',
cert: '',

View file

@ -104,6 +104,7 @@ const getPostgresConnectionOptions = (): PostgresConnectionOptions => {
schema: postgresConfig.schema,
poolSize: postgresConfig.poolSize,
migrations: postgresMigrations,
connectTimeoutMS: postgresConfig.connectionTimeoutMs,
ssl,
};
};