File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ type Config = {
50
50
// to the postgres server. This can be handy in scripts & tests
51
51
// where you don't want to wait for your clients to go idle before your process exits.
52
52
allowExitOnIdle? : boolean
53
+
54
+ // Sets a max overall life for the connection.
55
+ // A value of 60 would evict connections that have been around for over 60 seconds,
56
+ // regardless of whether they are idle. It's useful to force rotation of connection pools through
57
+ // middleware so that you can rotate the underlying servers. The default is disabled (value of zero)
58
+ maxLifetimeSeconds? : number
53
59
}
54
60
` ` `
55
61
@@ -64,6 +70,7 @@ const pool = new Pool({
64
70
max: 20 ,
65
71
idleTimeoutMillis: 30000 ,
66
72
connectionTimeoutMillis: 2000 ,
73
+ maxLifetimeSeconds: 60
67
74
})
68
75
```
69
76
You can’t perform that action at this time.
0 commit comments