#185 add some comments, const, Daniel to authors, and changelog

This commit is contained in:
Trent Mick 2014-11-17 21:45:41 -08:00
parent a280863be6
commit 980e281096
3 changed files with 13 additions and 5 deletions

View file

@ -16,3 +16,4 @@ Ryan Graham (https://github.com/rmg)
Alex Kocharin (https://github.com/rlidwka) Alex Kocharin (https://github.com/rlidwka)
Andrei Neculau (https://github.com/andreineculau) Andrei Neculau (https://github.com/andreineculau)
Mihai Tomescu (https://github.com/matomesc) Mihai Tomescu (https://github.com/matomesc)
Daniel Juhl (https://github.com/danieljuhl)

View file

@ -8,7 +8,9 @@ Known issues:
## bunyan 1.2.3 (not yet released) ## bunyan 1.2.3 (not yet released)
(nothing yet) - [issue #184] Fix log rotation for rotation periods > ~25 days. Before this
change, a rotation period longer than this could hit [the maximum setTimeout
delay in node.js](https://github.com/joyent/node/issues/8656). By Daniel Juhl.
## bunyan 1.2.2 ## bunyan 1.2.2
@ -36,8 +38,8 @@ Known issues:
problems from older versions: problems from older versions:
The build is not attempted on Linux and Windows. The build spew is The build is not attempted on Linux and Windows. The build spew is
*not* emitted by default (use `V=1 npm install` to see it); instead a *not* emitted by default (use `V=1 npm install` to see it); instead a
short warning is emitted if the build fails. short warning is emitted if the build fails.
Also, importantly, the new dtrace-provider fixes working with node Also, importantly, the new dtrace-provider fixes working with node
v0.11/0.12. v0.11/0.12.

View file

@ -1083,8 +1083,11 @@ RotatingFileStream.prototype._setupNextRot = function () {
var self = this; var self = this;
this.rotAt = this._nextRotTime(); this.rotAt = this._nextRotTime();
var delay = this.rotAt - Date.now(); var delay = this.rotAt - Date.now();
if (delay > 2147483647) { // Cap timeout to Node's max setTimeout, see
delay = 2147483647; // <https://github.com/joyent/node/issues/8656>.
var TIMEOUT_MAX = 2147483647; // 2^31-1
if (delay > TIMEOUT_MAX) {
delay = TIMEOUT_MAX;
} }
this.timeout = setTimeout( this.timeout = setTimeout(
function () { self.rotate(); }, function () { self.rotate(); },
@ -1179,6 +1182,8 @@ RotatingFileStream.prototype.rotate = function rotate() {
var self = this; var self = this;
var _DEBUG = false; var _DEBUG = false;
// If rotation period is > ~25 days, we have to break into multiple
// setTimeout's. See <https://github.com/joyent/node/issues/8656>.
if (self.rotAt && self.rotAt > Date.now()) { if (self.rotAt && self.rotAt > Date.now()) {
return self._setupNextRot(); return self._setupNextRot();
} }