dpacaud vor 12 Jahren
Ursprung
Commit
36df17afc0
1 geänderte Dateien mit 8 neuen und 9 gelöschten Zeilen
  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();
-    }
-  });
 }
 /**
  *