Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
refactor: move defer ticker.stop() to right after ticker init
Browse files Browse the repository at this point in the history
  • Loading branch information
elijaharita committed Nov 8, 2023
1 parent d9083b8 commit e5edad4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion integration/singularity/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ func (cs *cleanupScheduler) start(ctx context.Context) {
}()

ticker := time.NewTicker(cs.cfg.interval)
defer ticker.Stop()

// Run once immediately on startup
cs.cleanup(ctx)
defer ticker.Stop()

for {
select {
Expand Down

0 comments on commit e5edad4

Please sign in to comment.