Skip to content

Commit

Permalink
[minor] Restart process via process.nextTick
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Sep 28, 2010
1 parent 60ee8f3 commit 1861dbc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1861dbc

Please sign in to comment.