mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Add "unref" to timers (#3396)
* chore: add unref to timer see https://nodejs.org/api/timers.html#timeoutunref * chore: add unref to timer see https://nodejs.org/api/timers.html#timeoutunref * fix: lint * fix: lint * fix: lint * fix: lint
This commit is contained in:
parent
88311c17a5
commit
1876f2000a
@ -205,6 +205,10 @@ class Pool extends EventEmitter {
|
||||
response.callback(new Error('timeout exceeded when trying to connect'))
|
||||
}, this.options.connectionTimeoutMillis)
|
||||
|
||||
if (tid.unref) {
|
||||
tid.unref()
|
||||
}
|
||||
|
||||
this._pendingQueue.push(pendingItem)
|
||||
return result
|
||||
}
|
||||
|
||||
@ -104,6 +104,10 @@ class Client extends EventEmitter {
|
||||
con._ending = true
|
||||
con.stream.destroy(new Error('timeout expired'))
|
||||
}, this._connectionTimeoutMillis)
|
||||
|
||||
if (this.connectionTimeoutHandle.unref) {
|
||||
this.connectionTimeoutHandle.unref()
|
||||
}
|
||||
}
|
||||
|
||||
if (this.host && this.host.indexOf('/') === 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user