diff --git a/controller/error.go b/controller/error.go new file mode 100644 index 00000000..1b09c82b --- /dev/null +++ b/controller/error.go @@ -0,0 +1,9 @@ +package controller + +type ForgetError struct { + Err error +} + +func (f *ForgetError) Error() string { + return f.Err.Error() +} diff --git a/controller/generic_controller.go b/controller/generic_controller.go index dde151c0..bafffb8b 100644 --- a/controller/generic_controller.go +++ b/controller/generic_controller.go @@ -162,7 +162,7 @@ func (g *genericController) processNextWorkItem() bool { // do your work on the key. This method will contains your "do stuff" logic err := g.syncHandler(key.(string)) - if err == nil { + if _, ok := err.(*ForgetError); err == nil || ok { g.queue.Forget(key) return true }