Skip to content

Commit

Permalink
fix panic for nil rotationTicker
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrks committed May 23, 2024
1 parent 9daa438 commit c846fe1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base/logger_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ func (lfc *FileLoggerConfig) init(ctx context.Context, level LogLevel, name stri
WarnfCtx(ctx, "Panic when deleting rotated log files: %s\n%s", panicked, debug.Stack())
}
}()
defer rotationTicker.Stop()
if rotationTicker != nil {
defer rotationTicker.Stop()
}
defer logDeletionTicker.Stop()
for {
select {
Expand Down

0 comments on commit c846fe1

Please sign in to comment.