Using Good Job to track all ActiveJob executions, even those with perform_now
#1449
Replies: 1 comment
-
This isn't my favorite. I guess it works, but I imagine you'll have to keep that in sync with changes in GoodJob and it would be brittle. Still brittle, but one less of a database lookup, you could access Can I ask why you want to track What I usually see from folks is that they want to tie some aspect of their application/business logic to the job queue (e.g. |
Beta Was this translation helpful? Give feedback.
-
Hi there!
We would like to extend GoodJob to also track executions made by
perform_now
jobs, and would like to find out how we can create a GoodJob record manually without enqueuing it for any processing. This is what we did for now:For every job execution, and
after_perform
hook will be used to check for the existing of a good job record, if none is found, it will create one that mocks a "finished" job. No retrigger for this job should be allowed, it purely stays just as a reference.Any concerns with this approach?
Beta Was this translation helpful? Give feedback.
All reactions