Skip to content

Commit 550f4ff

Browse files
authored
Add allowExitOnIdle to pool API documentation (#151)
Address issue mentioned in brianc/node-postgres#2590
1 parent 018aa89 commit 550f4ff

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

content/api/1-pool.mdx

+11
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ config = {
2626
// maximum number of clients the pool should contain
2727
// by default this is set to 10.
2828
max?: int,
29+
30+
// Default behavior is the pool will keep clients open & connected to the backend
31+
// until idleTimeoutMillis expire for each client and node will maintain a ref
32+
// to the socket on the client, keeping the event loop alive until all clients are closed
33+
// after being idle or the pool is manually shutdown with `pool.end()`.
34+
//
35+
// Setting `allowExitOnIdle: true` in the config will allow the node event loop to exit
36+
// as soon as all clients in the pool are idle, even if their socket is still open
37+
// to the postgres server. This can be handy in scripts & tests
38+
// where you don't want to wait for your clients to go idle before your process exits.
39+
allowExitOnIdle?: boolean
2940
}
3041
```
3142

0 commit comments

Comments
 (0)