Fix #97 unref() the rotation timeout in RotatingFileStream.

The rotation `setTimeout` from `RotatingFileStream` will prevent the process from exiting.
This fix simply `unref()` the timeout immediately after it is set.
master
Chakrit Wichian 2013-08-21 14:47:28 +07:00
parent 27b679f243
commit 90360351b4
1 changed files with 3 additions and 0 deletions

View File

@ -990,6 +990,9 @@ RotatingFileStream.prototype._setupNextRot = function () {
this.timeout = setTimeout(
function () { self.rotate(); },
this.rotAt - Date.now());
if (typeof this.timeout.unref === 'function') {
this.timeout.unref();
}
}
RotatingFileStream.prototype._nextRotTime = function _nextRotTime(first) {