Skip to content

fix: replace time.Tick with time.NewTicker to prevent goroutine leak#1559

Open
Aprazor wants to merge 1 commit intoprometheus:masterfrom
Aprazor:fix/time-tick-goroutine-leak
Open

fix: replace time.Tick with time.NewTicker to prevent goroutine leak#1559
Aprazor wants to merge 1 commit intoprometheus:masterfrom
Aprazor:fix/time-tick-goroutine-leak

Conversation

@Aprazor
Copy link

@Aprazor Aprazor commented Mar 22, 2026

time.Tick inside a select creates a new ticker on every loop iteration
that is never stopped. Replace with a single NewTicker created before
the loop with defer Stop() for proper cleanup.

Signed-off-by: Aprazors Aprazors@gmail.com

time.Tick inside a select creates a new ticker on every loop iteration that is never stopped. Replace with a single NewTicker created before the loop with defer Stop() for proper cleanup. Signed-off-by: Aprazors <Aprazors@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant