From 56f05a900b03fb0c8dd635aede666c7d2f213271 Mon Sep 17 00:00:00 2001 From: Unitech Date: Fri, 11 May 2018 00:12:01 +0200 Subject: [PATCH] fix: bug because of const --- lib/API.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/API.js b/lib/API.js index aaea293f0..3c84365c4 100644 --- a/lib/API.js +++ b/lib/API.js @@ -50,7 +50,7 @@ class API { constructor (opts) { if (!opts) opts = {}; - const that = this; + var that = this; this.daemon_mode = typeof(opts.daemon_mode) == 'undefined' ? true : opts.daemon_mode; this.pm2_home = conf.PM2_ROOT_PATH; @@ -80,7 +80,7 @@ class API { else if (opts.independent == true && conf.IS_WINDOWS === false) { // Create an unique pm2 instance const crypto = require('crypto'); - const random_file = crypto.randomBytes(8).toString('hex'); + var random_file = crypto.randomBytes(8).toString('hex'); this.pm2_home = path.join('/tmp', random_file); // If we dont explicitly tell to have a daemon @@ -112,7 +112,7 @@ class API { this.gl_is_km_linked = false; try { - const pid = fs.readFileSync(conf.INTERACTOR_PID_PATH); + var pid = fs.readFileSync(conf.INTERACTOR_PID_PATH); pid = parseInt(pid.toString().trim()); process.kill(pid, 0); that.gl_is_km_linked = true;