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

Options are not passed correct when scheduling jobs #523

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

janmeier
Copy link
Contributor

The documentation mentions that

options supports all properties in send()

So I assume that means I should be able to pass e.g. { retryLimit: 42 }, and have my scheduled jobs retry 42 times.

I'm adding a failing test to showcase the expected behaviour :)

The options are being correct stored in the DB, but it seems they are not being set correctly when the job is queued.

I had a brief look at the code, and I think we need to spread the options here

({ name: QUEUES.SEND_IT, data: { name, data, options }, singletonKey: name, singletonSeconds: 60 }))

LMK if that makes sense, then I will update the PR.

@janmeier
Copy link
Contributor Author

So I tested the changes with our production deployment at Lenus, and spreading the options object fixes the retrying issues we've seen.
So I've pushed a commit with that :)

@timgit timgit merged commit 57b74cc into timgit:master Dec 5, 2024
3 checks passed
@timgit
Copy link
Owner

timgit commented Dec 5, 2024

thank you

@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 71be52d on janmeier:add-failing-schedule-metadata-test
into 463f2fc on timgit:master.

@jippi
Copy link

jippi commented Jan 2, 2025

@timgit Any chance to cut a release with this fix? seem to be the only thing in HEAD compared to the last tag, so a patch release would be appreciated for ease of use for folks wanting to pick it up ❤️

@timgit
Copy link
Owner

timgit commented Jan 8, 2025

Done!

@janmeier janmeier deleted the add-failing-schedule-metadata-test branch January 8, 2025 05:06
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.

4 participants