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 10, 2023
1 parent d6193a9 commit 7adcc08
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 7adcc08

Please sign in to comment.