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 6697e5e commit 3b533a5
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 3b533a5

Please sign in to comment.