From ddf44f3358c41480d9cf63f66e14fa1ad7525982 Mon Sep 17 00:00:00 2001 From: Unitech Date: Thu, 26 Apr 2018 23:45:04 +0200 Subject: [PATCH] fix: set DAEMON_ACTIVE to true when successfully connected --- src/InteractorClient.js | 2 +- src/InteractorDaemon.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/InteractorClient.js b/src/InteractorClient.js index 4912e12..759f8ce 100644 --- a/src/InteractorClient.js +++ b/src/InteractorClient.js @@ -437,7 +437,7 @@ module.exports = class InteractorDaemonizer { */ static getInteractInfo (cst, cb) { log('Getting interaction info') - if (process.env.PM2_NO_INTERACTION) return + if (process.env.PM2_NO_INTERACTION) return cb(new Error('PM2_NO_INTERACTION set')) this.ping(cst, (err, online) => { if (err || !online) return cb(new Error('Interactor is offline')) diff --git a/src/InteractorDaemon.js b/src/InteractorDaemon.js index 853d345..f24bb37 100644 --- a/src/InteractorDaemon.js +++ b/src/InteractorDaemon.js @@ -11,7 +11,7 @@ const PushInteractor = require('./push/PushInteractor.js') const Utility = require('./Utility.js') const PM2Client = require('./PM2Client.js') const TransporterInterface = require('./TransporterInterface.js') -const domain = require('domain') // eslint-disable-line +const domain = require('domain') // eslint-disable-line const WatchDog = require('./WatchDog') // use noop if not launched via IPC @@ -181,6 +181,7 @@ const InteractorDaemon = module.exports = class InteractorDaemon { } log('Connect transport with endpoints') + this.DAEMON_ACTIVE = true this.km_data = data this.transport.connect(data.endpoints, cb) })