Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Properly track DB disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
ilanbiala committed Mar 6, 2015
1 parent 6cce3d0 commit 81c2847
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions config/lib/mongoose.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ module.exports.connect = function(cb) {
});
};

module.exports.disconnect = function() {
mongoose.disconnect();
console.info(chalk.yellow('Disconnected from MongoDB.'));
module.exports.disconnect = function(cb) {
mongoose.disconnect(function(err) {
console.info(chalk.yellow('Disconnected from MongoDB.'));
cb(err);
});
};

0 comments on commit 81c2847

Please sign in to comment.