From ff19571c7d5c1adcb7db69122719a3dd3b346d0c Mon Sep 17 00:00:00 2001 From: andreagerino Date: Fri, 27 Nov 2015 21:14:01 +0100 Subject: [PATCH] ... --- routes/storage.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/routes/storage.js b/routes/storage.js index 897aff0..9921941 100644 --- a/routes/storage.js +++ b/routes/storage.js @@ -29,6 +29,8 @@ router.get('/:resource_id', function(req, res, next) { debug(err); next(err); + db.close(); + }else{ var collection = db.collection('resources'); @@ -55,6 +57,8 @@ router.get('/:resource_id', function(req, res, next) { } + db.close(); + }); } @@ -72,6 +76,8 @@ router.post('/', function(req, res, next){ debug(err); next(err); + db.close(); + }else{ var collection = db.collection('resources'); @@ -104,6 +110,8 @@ router.post('/', function(req, res, next){ debug(error); next(error); + db.close(); + } } -- 2.18.1