Skip to content

Commit

Permalink
fix(mongo-client): ensure close callback is called with client
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Mar 11, 2019
1 parent 7c111e0 commit f39e881
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/operations/mongo_client_ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,9 @@ function generateCredentials(client, username, password, options) {

function closeOperation(client, force, callback) {
const completeClose = err => {
client.emit('close', this);
client.emit('close', client);
for (const name in client.s.dbCache) {
client.s.dbCache[name].emit('close');
client.s.dbCache[name].emit('close', client);
}

client.removeAllListeners('close');
Expand Down

0 comments on commit f39e881

Please sign in to comment.