File tree 1 file changed +7
-3
lines changed
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({
215
215
} ,
216
216
217
217
/**
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.
219
221
*
220
- * @param callback
222
+ * @param callback with the database driver as 2nd callback argument
221
223
*/
222
224
getDbInstance : function ( callback ) {
223
225
return this . _run ( 'getDbInstance' , null , { run_on : new Date ( ) } )
@@ -303,7 +305,9 @@ var MongodbDriver = Base.extend({
303
305
}
304
306
305
307
prCB ( null , data ) ;
306
- db . close ( ) ;
308
+ if ( command !== 'getDbInstance' ) {
309
+ db . close ( ) ;
310
+ }
307
311
} ;
308
312
309
313
// Depending on the command, we need to use different mongo methods
You can’t perform that action at this time.
0 commit comments