mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
feat(core): Make Postgres connection timeout configurable (#10670)
This commit is contained in:
parent
e318a6323a
commit
81540318b4
|
@ -75,6 +75,10 @@ class PostgresConfig {
|
||||||
@Env('DB_POSTGRESDB_POOL_SIZE')
|
@Env('DB_POSTGRESDB_POOL_SIZE')
|
||||||
poolSize: number = 2;
|
poolSize: number = 2;
|
||||||
|
|
||||||
|
/** Postgres connection timeout (ms) */
|
||||||
|
@Env('DB_POSTGRESDB_CONNECTION_TIMEOUT')
|
||||||
|
connectionTimeoutMs: number = 1000;
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
ssl: PostgresSSLConfig;
|
ssl: PostgresSSLConfig;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@ describe('GlobalConfig', () => {
|
||||||
poolSize: 2,
|
poolSize: 2,
|
||||||
port: 5432,
|
port: 5432,
|
||||||
schema: 'public',
|
schema: 'public',
|
||||||
|
connectionTimeoutMs: 1000,
|
||||||
ssl: {
|
ssl: {
|
||||||
ca: '',
|
ca: '',
|
||||||
cert: '',
|
cert: '',
|
||||||
|
|
|
@ -104,6 +104,7 @@ const getPostgresConnectionOptions = (): PostgresConnectionOptions => {
|
||||||
schema: postgresConfig.schema,
|
schema: postgresConfig.schema,
|
||||||
poolSize: postgresConfig.poolSize,
|
poolSize: postgresConfig.poolSize,
|
||||||
migrations: postgresMigrations,
|
migrations: postgresMigrations,
|
||||||
|
connectTimeoutMS: postgresConfig.connectionTimeoutMs,
|
||||||
ssl,
|
ssl,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue