浏览代码

debugging ;)

dpacaud 12 年之前
父节点
当前提交
36df17afc0
共有 1 个文件被更改,包括 8 次插入9 次删除
  1. 8 9
      mysql-backend.js

+ 8 - 9
mysql-backend.js

@@ -91,20 +91,19 @@ StatdMySQLBackend.prototype.executeQuerries = function(sqlQuerries) {
           }
           else {
             //TODO : add better error handling code
-            console.log("Error while executing sql query : " + sqlQuerries[i]); 
+            console.log("Error while executing sql query"); 
           }
+          connection.end(function(err) {
+            if(err){
+              console.log("There was an error while trying to close DB connection");
+              //Let's make sure that socket is destroyed
+              connection.destroy();
+            }
+          });
         });  
       }
     }
   });
- 
-  connection.end(function(err) {
-    if(err){
-      console.log("There was an error while trying to close DB connection");
-      //Let's make sure that socket is destroyed
-      connection.destroy();
-    }
-  });
 }
 /**
  *