Skip to content

Commit

Permalink
enable object revisiting after a while
Browse files Browse the repository at this point in the history
Signed-off-by: Di Xu <stephenhsu90@gmail.com>
  • Loading branch information
dixudx committed Oct 27, 2023
1 parent a67b660 commit e0b238f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions yacht.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit e0b238f

Please sign in to comment.