Skip to content

Commit

Permalink
fix-bug: rotate 不压缩问题
Browse files Browse the repository at this point in the history
  • Loading branch information
RainyBow committed Jul 11, 2024
1 parent 71f39d6 commit 4d05feb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lumberjack.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ func (l *Logger) Write(p []byte) (n int, err error) {
func (l *Logger) Close() error {
l.mu.Lock()
defer l.mu.Unlock()
if l.millCh != nil {
close(l.millCh)
l.millCh = nil
}
return l.close()
}

Expand All @@ -175,10 +179,6 @@ func (l *Logger) close() error {
}
err := l.file.Close()
l.file = nil
if l.millCh != nil {
close(l.millCh)
l.millCh = nil
}
return err
}

Expand Down

0 comments on commit 4d05feb

Please sign in to comment.