From 17b024e930d810a7412a6b7dd19ff224ed994ac1 Mon Sep 17 00:00:00 2001 From: Charlie Voiselle <464492+angrycub@users.noreply.github.com> Date: Thu, 3 Nov 2022 17:55:17 -0400 Subject: [PATCH] Add missing timer reset --- .changelog/15134.txt | 3 +++ nomad/plan_queue.go | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 .changelog/15134.txt diff --git a/.changelog/15134.txt b/.changelog/15134.txt new file mode 100644 index 000000000000..3e4f358e74a4 --- /dev/null +++ b/.changelog/15134.txt @@ -0,0 +1,3 @@ +```release-note:bug +cleanup: fixed missing timer.Reset for plan queue stat emitter +``` \ No newline at end of file diff --git a/nomad/plan_queue.go b/nomad/plan_queue.go index 2ba35e068e9b..0c1cb554a716 100644 --- a/nomad/plan_queue.go +++ b/nomad/plan_queue.go @@ -201,6 +201,8 @@ func (q *PlanQueue) EmitStats(period time.Duration, stopCh <-chan struct{}) { defer stop() for { + timer.Reset(period) + select { case <-timer.C: stats := q.Stats()