Skip to content
This repository was archived by the owner on Nov 12, 2021. It is now read-only.

Commit d284c8b

Browse files
committed
set 30s timeout
1 parent ed269cc commit d284c8b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/pg/lib/connection.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ class Connection extends EventEmitter {
4343
}
4444
self.emit('connect')
4545
})
46-
this.stream.setTimeout(2000);
46+
47+
/**
48+
* Set socket timeout to 30s,
49+
* Any slow queries are seen as inactivity socket
50+
* Will get killed after 30s
51+
* Similar to statement_timeout, but this is one the client side
52+
*
53+
*/
54+
this.stream.setTimeout(30000);
4755
this.stream.on('timeout', () => {
4856
this.stream.end();
4957
this.emit('end');

packages/pg/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@safetyculture/pg",
3-
"version": "1.0.0",
3+
"version": "1.0.3",
44
"description": "PostgreSQL client - pure javascript & libpq with the same API",
55
"keywords": [
66
"database",

0 commit comments

Comments
 (0)