fractaledmind / acidic_job

Elegant, resilient, durable workflows for Rails apps
https://fractaledmind.github.io/acidic_job/
MIT License
487 stars 10 forks source link

Steps with Await Jobs raise RuntimeError with GoodJob #94

Open ahacop opened 2 months ago

ahacop commented 2 months ago

Unfortunately, it seems like the "Await Job" feature doesn't work with GoodJob.

GoodJob will raise an exception if a job's job_id is not equal to it's provider_job_id.

https://github.com/bensheldon/good_job/blob/9a781889eb6c66d713695352e4bfd509f96bc70b/app/models/good_job/job.rb#L370

It appears that the "Await Jobs" feature relies on staging jobs, and staged jobs use a different job_id than the provider_job_id.

I'll add a repro here shortly.

fractaledmind commented 2 months ago

Hmmm... That sucks. I'll need to dig into good_job more and think about how to rework this feature with that constraint in mind. I don't have an idea off the top of my head tho.

ahacop commented 2 months ago

Thanks for your response. Happy to help if I can.

I just added an additional test to the repro I made for #92, here: https://github.com/ahacop/acidic-job-good-job-repro/blob/efe69774eae689d2f073cc66b96fe33ece6d57e2/test/jobs/await_job_test.rb