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 = {
5050 // to the postgres server. This can be handy in scripts & tests
5151 // where you don't want to wait for your clients to go idle before your process exits.
5252 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
5359}
5460` ` `
5561
@@ -64,6 +70,7 @@ const pool = new Pool({
6470 max: 20 ,
6571 idleTimeoutMillis: 30000 ,
6672 connectionTimeoutMillis: 2000 ,
73+ maxLifetimeSeconds: 60
6774})
6875```
6976
You can’t perform that action at this time.
0 commit comments