(cron) emit disconnect and wait for nextTick to exit

This commit is contained in:
Unitech 2016-08-03 00:51:05 -07:00
parent aaa32e0e2b
commit 8c965ec678

View File

@ -94,7 +94,10 @@ function cronize(cron_pattern) {
var job = new cronJob({
cronTime: cron_pattern,
onTick: function() {
process.exit(0);
process.emit('disconnect');
process.nextTick(function() {
process.exit(0);
});
},
start: false
});