From f8e4ceaaf559074b2b0740a06d7b2a86334d4680 Mon Sep 17 00:00:00 2001 From: Alexander Elias Date: Tue, 16 Feb 2016 14:12:44 -0700 Subject: [PATCH 1/3] Added exitOnStop option, changed default to false --- lib/forever.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/forever.js b/lib/forever.js index a44aa03b..433974f3 100755 --- a/lib/forever.js +++ b/lib/forever.js @@ -272,13 +272,14 @@ forever.load = function (options) { // // Setup the incoming options with default options. // - options = options || {}; - options.loglength = options.loglength || 100; - options.logstream = options.logstream || false; - options.root = options.root || forever.root; - options.pidPath = options.pidPath || path.join(options.root, 'pids'); - options.sockPath = options.sockPath || path.join(options.root, 'sock'); - + options = options || {}; + options.loglength = options.loglength || 100; + options.logstream = options.logstream || false; + options.root = options.root || forever.root; + options.pidPath = options.pidPath || path.join(options.root, 'pids'); + options.sockPath = options.sockPath || path.join(options.root, 'sock'); + options.exitOnStop = options.exitOnStop || false; + // // If forever is initalized and the config directories are identical // simply return without creating directories @@ -315,6 +316,7 @@ forever.load = function (options) { forever.config.set('loglength', options.loglength); forever.config.set('logstream', options.logstream); forever.config.set('columns', options.columns); + forever.config.set('exitOnStop', options.exitOnStop); // // Setup timestamp to event logger @@ -516,7 +518,7 @@ forever.startServer = function () { var worker = new forever.Worker({ monitor: monitor, sockPath: forever.config.get('sockPath'), - exitOnStop: true + exitOnStop: forever.config.get('exitOnStop') }); worker.start(function (err) { From 4a9bfa1a0fad9e3ec8540e2f882c1a901f10f8b9 Mon Sep 17 00:00:00 2001 From: Alexander Elias Date: Tue, 16 Feb 2016 14:18:19 -0700 Subject: [PATCH 2/3] Fixed exitOnStop option to allow it to be modified --- lib/forever/worker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/forever/worker.js b/lib/forever/worker.js index 4c0228a5..ddaf6393 100644 --- a/lib/forever/worker.js +++ b/lib/forever/worker.js @@ -10,8 +10,8 @@ var Worker = exports.Worker = function (options) { options = options || {}; this.monitor = options.monitor; - this.sockPath = options.sockPath || forever.config.get('sockPath'); - this.exitOnStop = options.exitOnStop === true; + this.sockPath = options.sockPath || forever.config.get('sockPath'); + this.exitOnStop = options.exitOnStop || forever.config.get('exitOnStop'); this._socket = null; }; From 67919e313cbed994b827212249b061255688aafb Mon Sep 17 00:00:00 2001 From: PigeonJeorge Date: Sat, 20 Feb 2016 13:43:42 -0700 Subject: [PATCH 3/3] travis ci build --- lib/forever/worker.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/forever/worker.js b/lib/forever/worker.js index ddaf6393..05539a69 100644 --- a/lib/forever/worker.js +++ b/lib/forever/worker.js @@ -13,6 +13,7 @@ var Worker = exports.Worker = function (options) { this.sockPath = options.sockPath || forever.config.get('sockPath'); this.exitOnStop = options.exitOnStop || forever.config.get('exitOnStop'); + this._socket = null; };