问题
I have a gallery with photos, on which processing photos is through sidekiq.
When a gallery has photos that are processing or in queue, I'd like to write something in the page.
one option for this is to mark each photo with processing
when it is added to the queue, and let sidekiq worker remove that when finished. The downside is that I need to check if at least one photo is processing, meaning check all photos...
Is there a way to query sidekiq directly?
回答1:
You can use the sidekiq-status gem to track your jobs. You can then use code like Sidekiq::Status::working? job_id
to check if a specific job is running.
来源:https://stackoverflow.com/questions/25971649/querying-sidekiq-for-models-queued