Skip to content

Commit 567f57a

Browse files
committed
RE: change client to connection pool
1 parent 6b98a21 commit 567f57a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

reverse_engineering/helpers/connectionHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ const createClient = async (connectionInfo, logger) => {
121121
statement_timeout: Number(connectionInfo.queryRequestTimeout) || 60000,
122122
database: connectionInfo.database || connectionInfo.maintenanceDatabase,
123123
application_name: 'Hackolade',
124+
idleTimeoutMillis: Number(connectionInfo.queryRequestTimeout) || 10000,
124125
};
125126

126127
const client = await connectClient(config).catch(retryOnSslError(connectionInfo, config, logger));
@@ -153,8 +154,7 @@ const retryOnSslError = (connectionInfo, config, logger) => async error => {
153154
};
154155

155156
const connectClient = async config => {
156-
const client = new pg.Client(config);
157-
await client.connect();
157+
const client = new pg.Pool(config);
158158

159159
return client;
160160
};

0 commit comments

Comments
 (0)