-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Managing jobs with errors #929
Comments
Thanks for opening this issue. That's not good! It sounds like it could be one or both of these:
I do have a section in the readme that tries to explain this stuff, but I'll admit I haven't done a pass on it recently, so there is probably room for improvement: https://github.com/bensheldon/good_job/#retries (be sure to read down because you have to duplicate the In terms of recommendations, if you're able, I think running the Good Job Dashboard would give you the most administrative insights into what is happening and actions to take to discard these jobs: https://github.com/bensheldon/good_job/#api-only-rails-applications Alternatively, please take a look at the methods defined on Jobs themselves, as it's likely that you're simply destroying the record while it's executing and you should instead use one of these methods that safely take a lock on the record: good_job/app/models/good_job/job.rb Lines 201 to 204 in ec385cf
|
Hi @bensheldon, thank you for creating this library - it's an amazing library! This might be less of a bug and maybe more of a request for best practices or even documentation.
Context: I'm using
good_job
on Heroku on Rails-API app running Rails 6. Given that I'm using it on API-mode, I haven't yet set up the dashboard and I'm looking for non-dashboard solutions to the problems below:Sometimes, I have jobs that fail, mostly related to email (inactive email, wrong email et al), and I notice that creates hundreds of job in my
good_jobs
table and if that happens for too long, then my regular jobs start to get affected even if they are in anurgent
queue. I've tried deleting the duplicate or problematic jobs only to have them be created again, and I've tried deleting the original records only to havegood_job
try them again and give me an ActiveRecord'sRecordNotFound
error.So I am wondering, what's the best practice when you have problematic records? Is there a recommended way to delete the job that works best with
good_job
and/or are there settings that I'm overlooking? FWIW, I've tried to look through the documentation but nothing has fixed it so far, hence the questions here :)The text was updated successfully, but these errors were encountered: