We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e787fb commit fe31a32Copy full SHA for fe31a32
daily-rotate-file.js
@@ -105,7 +105,16 @@ var DailyRotateFile = function (options) {
105
if (options.zippedArchive) {
106
var gzName = params.name + '.gz';
107
if (fs.existsSync(gzName)) {
108
- fs.unlinkSync(gzName);
+ try {
109
+ fs.unlinkSync(gzName);
110
+ }
111
+ catch (_err) {
112
+ // file is there but we got an error when trying to delete,
113
+ // so permissions problem or concurrency issue and another
114
+ // process already deleted it we could detect the concurrency
115
+ // issue by checking err.type === ENOENT or EACCESS for
116
+ // permissions ... but then?
117
118
self.emit('logRemoved', gzName);
119
return;
120
}
0 commit comments