Lets say I have a Sidekiq task that processes products to my database. Each product is grouped by store, so an overly simplified example of my code would be something like this...
stores.each do |store|
store.products.each do |product|
ProductWorker.perform_async(product.id)
end
end
When all the products from one store have run. I'd like to update the stores last_updated
column with the current time. But only when the last task for that store has run. How can I achieve this?
You can try sidekiq-batch
gem to solve your problem. It's like paid Batches
feature of Sidekiq Pro
and has same api.
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