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
I recently migrated from node-postgres to postgres.js and ran into the issue that my script would never finish as the connection was still open and therefore block the node event loop.
node-postgres has a config option for this: allowExitOnIdle which they describe like this:
Default behavior is the pool will keep clients open & connected to the backend
until idleTimeoutMillis expire for each client and node will maintain a ref
to the socket on the client, keeping the event loop alive until all clients are closed
after being idle or the pool is manually shutdown with pool.end().
Setting allowExitOnIdle: true in the config will allow the node event loop to exit
as soon as all clients in the pool are idle, even if their socket is still open
to the postgres server. This can be handy in scripts & tests
where you don't want to wait for your clients to go idle before your process exits.
I believe that would be a great feature to have in postgres.js as well :)
The text was updated successfully, but these errors were encountered:
Hi.
I recently migrated from node-postgres to postgres.js and ran into the issue that my script would never finish as the connection was still open and therefore block the node event loop.
node-postgres has a config option for this:
allowExitOnIdle
which they describe like this:I believe that would be a great feature to have in postgres.js as well :)
The text was updated successfully, but these errors were encountered: