You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-1
Original file line number
Diff line number
Diff line change
@@ -600,7 +600,13 @@ There are no guarantees about queries executing in order unless using a transact
600
600
601
601
### Idle timeout
602
602
603
-
Connections will by default not close until `.end()` is called, but often it is useful to have them close when there is no activity or if using Postgres.js in eg. Lamdas / Serverless environments. This can be done using the `idle_timeout` option to specify the amount of seconds to wait before automatically closing an idle connection.
603
+
By default, connections will not close until `.end()` is called. However, it may be useful to have them close automatically when:
604
+
605
+
- there is no activity for some period of time
606
+
- if using Postgres.js in Lamdas / Serverless environments
607
+
- if using Postgres.js with a database service that automatically closes the connection after some time (see [`ECONNRESET` issue](https://github.com/porsager/postgres/issues/179))
608
+
609
+
This can be done using the `idle_timeout` option to specify the amount of seconds to wait before automatically closing an idle connection.
604
610
605
611
For example, to close idle connections after 2 seconds:
0 commit comments