proteus-cluster
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -279,15 +279,25 @@ /** | ||
// if all worker has been disconnected | ||
cluster.disconnect(function(){ | ||
logger.debug('all workers has been disconnected'); | ||
if (_pidfile) { | ||
try { | ||
fs.unlinkSync(_pidfile); | ||
} catch (e) { | ||
cluster.disconnect(function() { | ||
setTimeout(function() { | ||
function _shutdown() { | ||
logger.debug('all workers has been disconnected'); | ||
if (_pidfile) { | ||
try { | ||
fs.unlinkSync(_pidfile); | ||
} catch (e) { | ||
} | ||
} | ||
// in case worker processes are still alive | ||
process.nextTick(function() { | ||
logger.debug('process exit with code 0'); | ||
process.exit(0); | ||
}); | ||
} | ||
} | ||
// in case worker processes are still alive | ||
process.nextTick(function(){ | ||
logger.debug('process exit with code 0'); | ||
process.exit(0); | ||
}); | ||
if (!Object.keys(_disconnectTimer).length) { | ||
return _shutdown(); | ||
} | ||
setTimeout(_shutdown, _disconnectTimeout); | ||
}, 100); | ||
}); | ||
@@ -294,0 +304,0 @@ } |
{ | ||
"name": "proteus-cluster", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "start": "node app", |
25605
569