Permalink
Browse files

[minor] Restart process via process.nextTick

  • Loading branch information...
1 parent 60ee8f3 commit 1861dbcb3b4fec60b75b58124b5f9b4c4a23e0a6 @indexzero indexzero committed Sep 28, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/forever.js
View
@@ -47,7 +47,9 @@ Forever.prototype.run = function () {
self.times++;
if (self.options.forever || self.times < self.options.max) {
self.emit('restart', null, self);
- self.run();
+ process.nextTick(function () {
+ self.run();
+ });
}
else {
self.emit('exit', null, self);

0 comments on commit 1861dbc

Please sign in to comment.