From 835651e513c719cb94b8c5758ca0181590f8d23f Mon Sep 17 00:00:00 2001 From: Matin Rahmanian Date: Mon, 26 Apr 2021 23:26:48 +0200 Subject: [PATCH] Release ticker resources Signed-off-by: Matin Rahmanian --- health/health.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/health/health.go b/health/health.go index 35991cb08..89675295e 100644 --- a/health/health.go +++ b/health/health.go @@ -135,6 +135,7 @@ func PeriodicChecker(check Checker, period time.Duration) Checker { u := NewStatusUpdater() go func() { t := time.NewTicker(period) + defer t.Stop() for { <-t.C u.Update(check.Check()) @@ -150,6 +151,7 @@ func PeriodicThresholdChecker(check Checker, period time.Duration, threshold int tu := NewThresholdStatusUpdater(threshold) go func() { t := time.NewTicker(period) + defer t.Stop() for { <-t.C tu.Update(check.Check())