Skip to content

Commit e24407f

Browse files
author
Matt Berther
committed
update to handle concurrent access more gracefully
1 parent 2deef30 commit e24407f

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

daily-rotate-file.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ var DailyRotateFile = function (options) {
125125
var inp = fs.createReadStream(oldFile);
126126
var out = fs.createWriteStream(oldFile + '.gz');
127127
inp.pipe(gzip).pipe(out).on('finish', function () {
128-
fs.unlinkSync(oldFile);
128+
if (fs.existsSync(oldFile)) {
129+
fs.unlinkSync(oldFile);
130+
}
129131
self.emit('archive', oldFile + '.gz');
130132
});
131133
});

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"rimraf": "2.6.3"
4141
},
4242
"dependencies": {
43-
"file-stream-rotator": "^0.5.5",
43+
"file-stream-rotator": "^0.5.7",
4444
"object-hash": "^2.0.1",
4545
"triple-beam": "^1.3.0",
4646
"winston-transport": "^4.2.0"

0 commit comments

Comments
 (0)