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
function shutdown (app, server, exitCode = 0) {
gracefulShutdown(app, server, exitCode > 0 ? 'error' : 'info', () => {
try {
if (!pgPool.ending) {
log.info(`Shutting down DB connection pool; waiting: ${pgPool.waitingCount}, idle: ${pgPool.idleCount}`)
pgPool.end(error => {
if (error) throw error
})
}
} catch (err) {
log.error(err, 'An error occurred while shutting down the DB connection pool.')
} finally {
setTimeout(() => process.exit(exitCode), 2000)
}
})
}
Using pgPool.ending means I don't need to track that myself but I'm unsure if it's a "supported" property to rely on outside of the Pool object itself. If it is, can we document it?
The text was updated successfully, but these errors were encountered:
I wasn't sure if
Pool.ending
can be used externally but if so can we document it here?https://github.com/brianc/node-postgres-docs/blob/master/content/api/1-pool.mdx#properties
Per https://node-postgres.com/api/pool#pool.end I use
express-graceful-exit
with a callback that callsPool.end()
but only if the pool'sending
value is false, e.g.:Using
pgPool.ending
means I don't need to track that myself but I'm unsure if it's a "supported" property to rely on outside of thePool
object itself. If it is, can we document it?The text was updated successfully, but these errors were encountered: