Skip to content

fix(cloudflare): calculate retries not attempts #16834

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

stayallive
Copy link

The message.attempts property starts at 1 so we were calculating the number of attempts not the number of retries. Attempt 2 is the first retry not attempt 1.

Currently the retry count is the same as the number of messages in the batch this way:

Screenshot 2025-07-07 at 23 40 48

Additionally this causes the error rate to be quite nice and I have been assured my code is not THAT bad:

Screenshot 2025-07-07 at 23 41 43

See: https://developers.cloudflare.com/queues/configuration/javascript-apis/

The `message.attempts` property starts at 1 so we were calculating the number of attempts not the number of retries. Since attempt 2 is the first retry.
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

nice, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants