Skip to content

Commit 2b79d7e

Browse files
committed
reconciler: fix reconcile duration metric
The previous implementation lacked delayed execution, leading to end - now not reflecting the duration of the reconcile request handling.
1 parent 150f98b commit 2b79d7e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/internal/controller/controller.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ func (c *Controller) processNextWorkItem() bool {
175175

176176
// Update metrics after processing each item
177177
reconcileStartTS := time.Now()
178-
defer c.updateMetrics(time.Now().Sub(reconcileStartTS))
178+
defer func() {
179+
c.updateMetrics(time.Now().Sub(reconcileStartTS))
180+
}()
179181

180182
obj, shutdown := c.Queue.Get()
181183
if obj == nil {

0 commit comments

Comments
 (0)