Browse Source

testing mysql connection

dpacaud 12 năm trước cách đây
mục cha
commit
effcfe4631
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      mysql-backend.js

+ 3 - 1
mysql-backend.js

@@ -45,8 +45,10 @@ function StatdMySQLBackend(startupTime, config, emitter) {
  * @param metrics
  */
 StatdMySQLBackend.prototype.onFlush = function(time_stamp, metrics) {
+
   console.log("onFlush event Recieved");
-  var connection = _mysql.createConnection(this.config);
+  var self = this;
+  var connection = _mysql.createConnection(self.config);
   connection.query('SELECT 1', function(err, rows) {
     if(!err) {
       console.log("DB connected");