From e0b238fcd7b3da3f952fa0bfb16b4050648a1792 Mon Sep 17 00:00:00 2001 From: Di Xu Date: Fri, 27 Oct 2023 17:30:04 +0800 Subject: [PATCH] enable object revisiting after a while Signed-off-by: Di Xu --- yacht.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yacht.go b/yacht.go index b689215..00b8673 100644 --- a/yacht.go +++ b/yacht.go @@ -289,6 +289,11 @@ func (c *Controller) processNextWorkItem() bool { requeueAfter, err := c.handlerFunc(item) if err == nil { c.queue.Forget(item) + if requeueAfter != nil { + // Sometimes we may want to re-visit this object after a while. + // Put the item back on the work queue with delay. + c.queue.AddAfter(item, *requeueAfter) + } return true }