From a784e8c2b385eca0dedd071709cdc2c49cabb60f Mon Sep 17 00:00:00 2001 From: okdistribute <633012+okdistribute@users.noreply.github.com> Date: Tue, 22 Sep 2020 14:35:18 -0700 Subject: [PATCH] fix: cleanup debug messaging on killing node proc --- src/pid-manager.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pid-manager.js b/src/pid-manager.js index de609f61c..b91ac1e74 100644 --- a/src/pid-manager.js +++ b/src/pid-manager.js @@ -17,7 +17,7 @@ class Worker extends events.EventEmitter { create ({socketName, filepath}, cb) { logger.debug('Creating subprocess', socketName, filepath) this.cleanup((err) => { - if (err) logger.debug('Not fatal', err) + if (err) logger.error(err) logger.debug('Starting background process') this.process = fork(filepath, [ '--subprocess', @@ -62,11 +62,10 @@ class Worker extends events.EventEmitter { cleanup (cb) { if (this.process) this.process.kill() this.process = null - if (!this._exists()) return cb(new Error('Nothing to clean up!')) + if (!this._exists()) return cb() var pid = this.read() logger.info('Terminating PID', pid) terminate(pid, (err) => { - if (err) logger.error(err) if (err && err.code !== 'ESRCH') return cb(err) this._remove(cb) })