Skip to content

Commit

Permalink
requeue implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Jeeva Kandasamy <[email protected]>
  • Loading branch information
jkandasa committed Jun 18, 2023
1 parent ffbdec8 commit 470399f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/service/handler/message_listerner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 5 additions & 0 deletions plugin/handler/types/handler.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package handler

import (
"errors"
"strings"
"time"

Expand All @@ -17,6 +18,10 @@ const (
DataTypeBackup = "backup"
)

var (
ErrReQueue = errors.New("requeue")
)

// Plugin interface details for operation
type Plugin interface {
Name() string
Expand Down

0 comments on commit 470399f

Please sign in to comment.