diff --git a/pkg/service/handler/message_listerner.go b/pkg/service/handler/message_listerner.go index 4b2e7db..34b4d41 100644 --- a/pkg/service/handler/message_listerner.go +++ b/pkg/service/handler/message_listerner.go @@ -63,6 +63,9 @@ func (svc *HandlerService) processHandlerMessage(item interface{}) { err := handler.Post(msg.Data) if err != nil { + if err == handlerTY.ErrReQueue { + // TODO: requeue and try again + } svc.logger.Warn("error from handler", zap.Any("handlerID", msg.ID), zap.Error(err)) state.Status = types.StatusError state.Message = err.Error() diff --git a/plugin/handler/types/handler.go b/plugin/handler/types/handler.go index 02fe128..dcb8de0 100644 --- a/plugin/handler/types/handler.go +++ b/plugin/handler/types/handler.go @@ -1,6 +1,7 @@ package handler import ( + "errors" "strings" "time" @@ -17,6 +18,10 @@ const ( DataTypeBackup = "backup" ) +var ( + ErrReQueue = errors.New("requeue") +) + // Plugin interface details for operation type Plugin interface { Name() string