Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bandaid server process-restart for dev-mode

  • Loading branch information...
commit ec4204ab6ee0bfcc03a26cb922a135e6ca240312 1 parent eb27b04
mde authored
Showing with 13 additions and 7 deletions.
  1. +13 −7 lib/cluster/master.js
View
20 lib/cluster/master.js
@@ -170,13 +170,13 @@ Master.prototype = new (function () {
if (self.processMode == processModes.WATCH_FILES) {
if (!data.killed) {
killWorker = true;
- self.stderrLog.warning('Code changed, killing ' +
- worker.pid + ', cycling ...');
+ self.stdoutLog.info('Code changed, killing ' +
+ worker.process.pid + ', cycling ...');
}
}
if (killWorker) {
- self.killWorker(worker.pid);
+ self.killWorker(worker.process.pid);
}
});
@@ -253,11 +253,17 @@ Master.prototype = new (function () {
this.createWorkers = function () {
var configCount = this.config.workers
, currentCount = this.workers.count
- , needed = configCount - currentCount
+ , needed
, rotationWindow = this.config.rotationWindow
, staggerInterval = rotationWindow / needed
, retirement = (new Date()).getTime() + rotationWindow
, msg;
+
+ if (this.processMode == processModes.WATCH_FILES) {
+ currentCount = 0;
+ }
+ needed = configCount - currentCount
+
if (needed) {
msg = 'Creating ' + needed + ' worker process';
msg += needed > 1 ? 'es.' : '.';
@@ -323,10 +329,10 @@ Master.prototype = new (function () {
, id = pid.toString()
, worker = this.workers.getItem(id);
worker.killed = true;
- try {
+ //try {
process.kill(pid);
- }
- catch(e) {}
+ //}
+ //catch(e) {}
// handleWorkerExit gets called on the process die/exit event.
// If for some reason it doesn't get called, we still want
// the process removed from the list of active proceses
Please sign in to comment.
Something went wrong with that request. Please try again.