From 89caea32ebc4c6008a1c005a38c2acdebdf79b92 Mon Sep 17 00:00:00 2001 From: Iain Sproat <68657+iainsproat@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:14:14 +0000 Subject: [PATCH] chore(knex): adds comments around config choices. No code changes (#3696) --- packages/shared/src/environment/multiRegionConfig.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/shared/src/environment/multiRegionConfig.ts b/packages/shared/src/environment/multiRegionConfig.ts index 27c504165..7774126bd 100644 --- a/packages/shared/src/environment/multiRegionConfig.ts +++ b/packages/shared/src/environment/multiRegionConfig.ts @@ -141,8 +141,10 @@ export const createKnexConfig = ({ pool: { min: 0, max: maxConnections, - acquireTimeoutMillis: 16000, //allows for 3x creation attempts plus idle time between attempts - createTimeoutMillis: 5000 + acquireTimeoutMillis: 16000, // If the maximum number of connections is reached, it wait for 16 seconds trying to acquire an existing connection before throwing a timeout error. + createTimeoutMillis: 5000 // If no existing connection is available and the maximum number of connections is not yet reached, the pool will try to create a new connection for 5 seconds before throwing a timeout error. + // createRetryIntervalMillis: 200, // Irrelevant & ignored because propogateCreateError is true. + // propagateCreateError: true // The propagateCreateError is set to true by default in Knex and throws a TimeoutError if the first create connection to the database fails. Knex recommends that this value is NOT set to false, despite what 'helpful' people on Stackoverflow tell you: https://github.com/knex/knex/issues/3455#issuecomment-535554401 } } }