-
Notifications
You must be signed in to change notification settings - Fork 165
Pass job.id to the executing job as provider_job_id for access within perform() #529
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
Conversation
In my quick testing on my local app with this branch it still doesn't seem to work, so please hold off merging :) |
Ok, now it's working. My mistake was passing a symbol instead of a string. A test would still be good though. |
Thank you @brendon!
Good question! I think you could try adding a new test job (to |
Thanks for the tip. I've added a passing test. I think this one is ready to go. I'm not 100% sure that's the best point to inject into the arguments but I couldn't find a better spot. |
Hi @rosa, did you need anything more from me to merge this PR? :) |
Hey @brendon, sorry for the delay! I think this is ready, thank you so much! 🙏 |
No worries :) Thank you too. If it’s not too much trouble would you be able to release a new gem version in the next little while? :) |
@brendon yes! Going to release a new version today. |
Nice! :D Thank you :) |
Sometimes it's handy to have
provider_job_id
available withinperform
. The Sidekiq adapter does it and Rails allows for it:https://github.com/rails/rails/blob/aa2bfad1a137c9add1b35de118b391494e13ca06/activejob/lib/active_job/core.rb#L35
So far I'm not sure how to test this and the suite doesn't appear to go so far as testing the execution of jobs or at least what is available within
perform()
. Some guidance would be much appreciated :)Closes #514