Skip to content

Commit

Permalink
Merge 56e0f37 into 371f152
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Apr 8, 2022
2 parents 371f152 + 56e0f37 commit dd2306b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/factories/createPoolConfiguration.ts
Expand Up @@ -58,6 +58,16 @@ export const createPoolConfiguration = (dsn: string, clientConfiguration: Client
}
}

if (clientConfiguration.idleTimeout !== 'DISABLE_TIMEOUT') {
if (clientConfiguration.idleTimeout === 0) {
log.warn('idleTimeout=0 sets timeout to 0 milliseconds; use idleTimeout=DISABLE_TIMEOUT to disable timeout');

poolConfiguration.idleTimeoutMillis = 1;
} else {
poolConfiguration.idleTimeoutMillis = clientConfiguration.idleTimeout;
}
}

if (clientConfiguration.idleInTransactionSessionTimeout !== 'DISABLE_TIMEOUT') {
if (clientConfiguration.idleInTransactionSessionTimeout === 0) {
log.warn('idleInTransactionSessionTimeout=0 sets timeout to 0 milliseconds; use idleInTransactionSessionTimeout=DISABLE_TIMEOUT to disable timeout');
Expand Down

0 comments on commit dd2306b

Please sign in to comment.