-
Notifications
You must be signed in to change notification settings - Fork 160
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
Accessing the job from within the perform method #514
Comments
Hey @brendon, you're right, this is currently not accessible to the job from within the It should be easy to add, though. If you or anyone else wants to open a PR with that, I'd be happy to review it. |
Thanks @rosa, I'll put together a PR :) |
Hi @rosa, just wondering if there are any instructions around developing on this project? I'm having a bit of trouble getting a test suite up and running. I see a docker setup there but it only creates the database machines. |
Oh, @brendon, you're right, I should put together some instructions for contributing. In theory, you should simply need to run |
Thanks for the heads up :D Just the error about the port conflict that I've raised an issue on: #528. I have the test suite running so will try and work on this PR now :D |
I'm currently using
DelayedJob
with this custom plugin that allows me to access theprovider_job_id
from within theperform
method of a job:The Sidekiq adapter in Rails also does something similar:
https://github.com/rails/rails/pull/25961/files#diff-e1ee600ca5fd100da20810ef5acbab89546064fc323c7b1e6bdb6ed5e681a9d3L40
I'm intending to migrate to Solid Queue but just wondered if this is an option currently? From looking at the source I don't see the job id being passed in. I have two use cases:
job_id
in the database so that I can destroy that job and schedule a new job if the user changes the time it should run.updated_at
that is greater than the job'screated_at
. This signals that there's now a newer job scheduled that should take precedence. I use this for WebPush notifications.The text was updated successfully, but these errors were encountered: