Skip to content

Commit

Permalink
move guard higher and add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
td-tomasz committed Apr 26, 2023
1 parent 58573a2 commit 99bc940
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/winston/transports/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ module.exports = class File extends TransportStream {
debug('logged %s %s', this._size, output);
this.emit('logged', info);

// Do not attempt to rotate files while opening
if (this._opening) {
// Do not attempt to rotate files while rotating
if (this._rotate) {
return;
}
if (this._rotate) {

// Do not attempt to rotate files while opening
if (this._opening) {
return;
}

Expand Down

0 comments on commit 99bc940

Please sign in to comment.