Skip to content

Commit

Permalink
Log and ignore MessageNotInflight error for ChangeMessageVisibility
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdnk committed Oct 23, 2024
1 parent 8e30a83 commit 2930aae
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sqsjobs/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sqsjobs

import (
"context"
"log"
"maps"
"strconv"
"strings"
Expand All @@ -17,6 +18,8 @@ import (
"github.com/roadrunner-server/api/v4/plugins/v4/jobs"
"github.com/roadrunner-server/errors"
"go.uber.org/zap"

goErrors "errors"
)

const (
Expand Down Expand Up @@ -189,7 +192,13 @@ func CommonNack(i *Item) error {
})

if err != nil {
return err
var notInFlight *types.MessageNotInflight
if goErrors.As(err, &notInFlight) {
// I would like to log info/warning here, but not sure how to get the correct logger
log.Println("MessageNotInFlight; ignoring ChangeMessageVisibility")
} else {
return err
}
}
} // else dont do anything; wait for VisibilityTimeout to expire.

Expand Down

0 comments on commit 2930aae

Please sign in to comment.