With Rails 3.2, is it possible to setup a delayed job so that it has a dependency on another delayed job, such that it will not run until the other job has finished (either successfully or not)? I have a class that spins off a large number of delayed jobs that need to be run sequentially to prevent a race condition. For performance reasons it is not possible to wait for each job to complete synchronously, though if it's not possible to put dependencies on jobs I could create a delayed job that runs each job in turn and waits for it to complete.
I agree with the author of this thread:
I would create a model to keep track of which steps are finished and not enqueue the next step until the previous ones are finished.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With