Skip to content

Commit edcb257

Browse files
authored
Add note to idle_timeout about ECONNRESET (porsager#180)
1 parent 6b0f4d0 commit edcb257

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,13 @@ There are no guarantees about queries executing in order unless using a transact
600600

601601
### Idle timeout
602602

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.
604610

605611
For example, to close idle connections after 2 seconds:
606612

0 commit comments

Comments
 (0)