Skip to content

Commit f39e881

Browse files
committed
fix(mongo-client): ensure close callback is called with client
1 parent 7c111e0 commit f39e881

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/operations/mongo_client_ops.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,9 @@ function generateCredentials(client, username, password, options) {
665665

666666
function closeOperation(client, force, callback) {
667667
const completeClose = err => {
668-
client.emit('close', this);
668+
client.emit('close', client);
669669
for (const name in client.s.dbCache) {
670-
client.s.dbCache[name].emit('close');
670+
client.s.dbCache[name].emit('close', client);
671671
}
672672

673673
client.removeAllListeners('close');

0 commit comments

Comments
 (0)