Skip to content

Commit

Permalink
feat(core): Make Postgres connection timeout configurable (#10670)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov authored Sep 5, 2024
1 parent e318a63 commit 8154031
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/@n8n/config/src/configs/database.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions packages/@n8n/config/test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ describe('GlobalConfig', () => {
poolSize: 2,
port: 5432,
schema: 'public',
connectionTimeoutMs: 1000,
ssl: {
ca: '',
cert: '',
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/databases/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const getPostgresConnectionOptions = (): PostgresConnectionOptions => {
schema: postgresConfig.schema,
poolSize: postgresConfig.poolSize,
migrations: postgresMigrations,
connectTimeoutMS: postgresConfig.connectionTimeoutMs,
ssl,
};
};
Expand Down

0 comments on commit 8154031

Please sign in to comment.