rotating-file-stream
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -0,1 +1,4 @@ | ||
- 2020-01-26 - v2.0.2 | ||
- Fixed two [bugs](https://github.com/iccicci/rotating-file-stream/pull/47) | ||
- devDependencies update | ||
- 2019-12-24 - v2.0.1 | ||
@@ -2,0 +5,0 @@ - Fixed a [bug about setTimeout on some node environments](https://github.com/iccicci/rotating-file-stream/pull/46) (thanks to [Rastopyr](https://github.com/Rastopyr)) |
@@ -79,2 +79,6 @@ "use strict"; | ||
return destroy(this.error); | ||
if (!this.stream) { | ||
this.opened = rewrite; | ||
return; | ||
} | ||
const done = (error) => { | ||
@@ -348,3 +352,5 @@ if (error) | ||
const time = this.next - this.now().getTime(); | ||
this.timer = time > this.maxTimeout ? timers_1.setTimeout(set, this.maxTimeout) : timers_1.setTimeout(() => this.rotate(error => (this.error = error)), time); | ||
if (time <= 0) | ||
return this.rotate(error => (this.error = error)); | ||
this.timer = timers_1.setTimeout(set, time > this.maxTimeout ? this.maxTimeout : time); | ||
this.timer.unref(); | ||
@@ -351,0 +357,0 @@ }; |
{ | ||
"name": "rotating-file-stream", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Opens a stream.Writable to a file rotated by interval and/or size. A logrotate alternative.", | ||
@@ -43,11 +43,11 @@ "scripts": { | ||
"@types/mocha": "5.2.7", | ||
"@types/node": "13.1.0", | ||
"@typescript-eslint/eslint-plugin": "2.13.0", | ||
"@typescript-eslint/parser": "2.13.0", | ||
"@types/node": "13.5.0", | ||
"@typescript-eslint/eslint-plugin": "2.17.0", | ||
"@typescript-eslint/parser": "2.17.0", | ||
"eslint": "6.8.0", | ||
"mocha": "6.2.2", | ||
"mocha": "7.0.1", | ||
"nyc": "15.0.0", | ||
"ts-node": "8.5.4", | ||
"typescript": "3.7.4" | ||
"ts-node": "8.6.2", | ||
"typescript": "3.7.5" | ||
} | ||
} |
58199
6
808