mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
Format with prettier
This commit is contained in:
parent
edf1a864d6
commit
9a61e9ac58
@ -255,9 +255,14 @@ class Pool extends EventEmitter {
|
||||
setTimeout(() => {
|
||||
this.log('ending client due to expired lifetime')
|
||||
this._expired.add(client)
|
||||
const idleIndex = this._idle.findIndex(idleItem => idleItem.client === client)
|
||||
const idleIndex = this._idle.findIndex((idleItem) => idleItem.client === client)
|
||||
if (idleIndex !== -1) {
|
||||
this._acquireClient(client, new PendingItem((err, client, clientRelease) => clientRelease()), idleListener, false)
|
||||
this._acquireClient(
|
||||
client,
|
||||
new PendingItem((err, client, clientRelease) => clientRelease()),
|
||||
idleListener,
|
||||
false
|
||||
)
|
||||
}
|
||||
}, this.options.maxLifetimeSeconds * 1000)
|
||||
}
|
||||
|
||||
@ -29,7 +29,8 @@ describe('lifetime timeout', () => {
|
||||
done()
|
||||
})
|
||||
})
|
||||
it('can remove expired clients and recreate them',
|
||||
it(
|
||||
'can remove expired clients and recreate them',
|
||||
co.wrap(function* () {
|
||||
const pool = new Pool({ maxLifetimeSeconds: 1 })
|
||||
let query = pool.query('SELECT pg_sleep(1)')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user