Skip to content

Commit

Permalink
Moving gzip_finish event handler with other event handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Rcomian committed May 9, 2021
1 parent f2bfc33 commit c76dd37
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/rotatingfilestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ function RotatingFileStream(options) {
var shared = options.shared;

var rotator = FileRotator(path, totalFiles, totalSize, gzip);
rotator.on('gzip_finish', function(zippedPath) {
base.emit('gzip_finish', zippedPath);
});

var stream = null;
var streambytesWritten = 0;
Expand Down Expand Up @@ -185,6 +182,10 @@ function RotatingFileStream(options) {
writeQueue.resume();
});

rotator.on('gzip_finish', function(zippedPath) {
base.emit('gzip_finish', zippedPath);
});

function initialise() {
rotator.initialise(options.startNewFile, function (err) {
if (err) {
Expand Down

0 comments on commit c76dd37

Please sign in to comment.