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

Commit

Permalink
Update teardown method
Browse files Browse the repository at this point in the history
  • Loading branch information
sgress454 committed Apr 29, 2014
1 parent aa86451 commit 545f61a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/adapter.js
Expand Up @@ -41,13 +41,21 @@ module.exports = (function () {
connections[connection.identity].initialize(cb);
},

// Teardown a Connection
teardown: function (conn, cb) {

if (typeof conn == 'function') {
cb = conn;
conn = null;
}
if (conn == null) {
connections = {};
return cb();
}
if(!connections[conn]) return cb();
delete connections[conn];
cb();
},

// Return attributes
describe: function (conn, coll, cb) {
grabConnection(conn).describe(coll, cb);
Expand Down

0 comments on commit 545f61a

Please sign in to comment.