small fix to locking
This commit is contained in:
@@ -187,8 +187,6 @@ func (lf *amLogFile) rotate() error {
|
|||||||
if lf.keep == 0 && lf.keepCompressed == 0 {
|
if lf.keep == 0 && lf.keepCompressed == 0 {
|
||||||
return nil // degenerate case, keep the log file the same
|
return nil // degenerate case, keep the log file the same
|
||||||
}
|
}
|
||||||
lf.mutex.Lock()
|
|
||||||
defer lf.mutex.Unlock()
|
|
||||||
// Close existing logfile if it's open.
|
// Close existing logfile if it's open.
|
||||||
reopen := lf.wr != nil
|
reopen := lf.wr != nil
|
||||||
if reopen {
|
if reopen {
|
||||||
|
|||||||
Reference in New Issue
Block a user