Commits

Alvaro Videla  committed b1c3fb6

adds check for mongodb connection status

  • Participants
  • Parent commits fd9d59b

Comments (0)

Files changed (1)

File lib/services.js

 var mongodbConn;
 
 function getMongoDbConnection(callback) {
-    if (mongodbConn) {
+    if (mongodbConn && mongodbConn.state == 'connected') {
         callback(null, mongodbConn);
     } else {
         mongodb.connect(cf_utils.getMongoUrl(), function(err, conn) {