File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -215,9 +215,11 @@ var MongodbDriver = Base.extend({
215215 } ,
216216
217217 /**
218- * Returns the DB instance so custom updates can be made
218+ * Returns the DB instance so custom updates can be made.
219+ * NOTE: This method exceptionally does not call close() on the database driver when the promise resolves. So the getDbInstance method caller
220+ * needs to call .close() on it's own after finish working with the database driver.
219221 *
220- * @param callback
222+ * @param callback with the database driver as 2nd callback argument
221223 */
222224 getDbInstance : function ( callback ) {
223225 return this . _run ( 'getDbInstance' , null , { run_on : new Date ( ) } )
@@ -303,7 +305,9 @@ var MongodbDriver = Base.extend({
303305 }
304306
305307 prCB ( null , data ) ;
306- db . close ( ) ;
308+ if ( command !== 'getDbInstance' ) {
309+ db . close ( ) ;
310+ }
307311 } ;
308312
309313 // Depending on the command, we need to use different mongo methods
You can’t perform that action at this time.
0 commit comments