Skip to content

Commit

Permalink
fix: set DAEMON_ACTIVE to true when successfully connected
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Apr 26, 2018
1 parent c5ad2a2 commit ddf44f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/InteractorClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
3 changes: 2 additions & 1 deletion src/InteractorDaemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
})
Expand Down

0 comments on commit ddf44f3

Please sign in to comment.