diff --git a/CHANGELOG.md b/CHANGELOG.md index d0904880fe3..8c72e2649f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ - Add Azure Pipelines Scaler ([#1706](https://github.com/kedacore/keda/pull/1706)) - Add OpenStack Metrics Scaler ([#1382](https://github.com/kedacore/keda/issues/1382)) -- Fixed goroutine leaks in usage of timers ([#1704](https://github.com/kedacore/keda/pull/1704)) +- Fixed goroutine leaks in usage of timers ([#1704](https://github.com/kedacore/keda/pull/1704) | [#1739](https://github.com/kedacore/keda/pull/1739)) ### New diff --git a/pkg/scaling/scale_handler.go b/pkg/scaling/scale_handler.go index 991110db0a7..1adc62e18e6 100644 --- a/pkg/scaling/scale_handler.go +++ b/pkg/scaling/scale_handler.go @@ -140,8 +140,9 @@ func (h *scaleHandler) startScaleLoop(ctx context.Context, withTriggers *kedav1a pollingInterval := getPollingInterval(withTriggers) logger.V(1).Info("Watching with pollingInterval", "PollingInterval", pollingInterval) - tmr := time.NewTimer(pollingInterval) for { + tmr := time.NewTimer(pollingInterval) + select { case <-tmr.C: h.checkScalers(ctx, scalableObject, scalingMutex)