Nick Ginanto
Nick Ginanto

Reputation: 32140

Querying sidekiq for models queued

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?

Upvotes: 1

Views: 786

Answers (1)

zwippie
zwippie

Reputation: 15515

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.

Upvotes: 2

Related Questions