Skip to content

Commit aa7e533

Browse files
committed
DEBUG Redshift: more pg connection debugging
1 parent c99c49b commit aa7e533

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/cubejs-postgres-driver/src/PostgresDriver.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,13 @@ export class PostgresDriver<Config extends PostgresDriverConfiguration = Postgre
138138
...config
139139
});
140140
this.pool.on('error', (err) => {
141-
console.log(`Unexpected error on idle client: ${err.stack || err}`); // TODO
141+
console.log(`[${new Date().toISOString()}] Unexpected error on idle client: ${err.stack || err}`);
142+
});
143+
this.pool.on('connect', (client) => {
144+
console.log(`[${new Date().toISOString()}] New pool connection established`);
145+
});
146+
this.pool.on('remove', (client) => {
147+
console.log(`[${new Date().toISOString()}] Pool connection removed`);
142148
});
143149
this.config = <Partial<Config>>{
144150
...this.getInitialConfiguration(dataSource),

0 commit comments

Comments
 (0)