Skip to content

Commit 293cfa8

Browse files
committed
fix: context problem
1 parent b906051 commit 293cfa8

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
@@ -164,8 +164,9 @@ class Pool extends EventEmitter {
164164
}
165165

166166
this._clients = this._clients.filter((c) => c !== client)
167+
const context = this
167168
client.end(() => {
168-
this.emit('remove', client)
169+
context.emit('remove', client)
169170

170171
if (typeof callback === 'function') {
171172
callback()

0 commit comments

Comments
 (0)