Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reject a faulty delivery logic #147

Merged
merged 3 commits into from
Jun 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add a comment about why we reject a faulty delivery
  • Loading branch information
mariaefi29 committed Jun 23, 2023
commit 4e138108e600d1f535521e960dd3d3aba66d516d
2 changes: 1 addition & 1 deletion queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@
if err == ErrorNotFound {
return nil
}

if err != nil {
return err
}
Expand Down Expand Up @@ -245,12 +244,13 @@
return rd, nil
}

// we need to reject a delivery here to move the delivery from the unacked to the rejected list.
rejectErr := rd.Reject()
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if err != nil {
if rejectErr != nil {

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thank you! It was a bug!

return nil, fmt.Errorf("%s, reject faulty delivery: %w", err, rejectErr)
}

return nil, err

Check notice on line 253 in queue.go

View workflow job for this annotation

GitHub Actions / test (1.19.x)

1 statement(s) are not covered by tests.
}

// StopConsuming can be used to stop all consumers on this queue. It returns a
Expand Down