Skip to content

Commit 8e48dda

Browse files
asadbek2021hjr3
authored andcommitted
fix: context problem
1 parent 7e5f134 commit 8e48dda

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/pg-pool/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@ class Pool extends EventEmitter {
169169
}
170170

171171
this._clients = this._clients.filter((c) => c !== client)
172+
const context = this
172173
client.end(() => {
173-
this.emit('remove', client)
174+
context.emit('remove', client)
174175

175176
if (typeof callback === 'function') {
176177
callback()

0 commit comments

Comments
 (0)