Best Way to Monitor for Completion of a Sidekiq Job

Sidekiq query for job completion

Hi Ilovebathroomlights

There are several approaches I can use, one of them I am writing below assuming you are okay to write a state to Redis, Database, or any storage you might be using and can be used to poll.

You can start by assigning a unique id to your sidekiq job, and save this id with status as "pending", at the last line inside the sidekiq job code, update the status of the unique id as "completed".

In meantime, you can poll by the unique id you generated for the particular job, and refresh the data or refresh the page.

Polling Sidekiq Job for Completion via Processing State in Database

With the tools you have you seem to be on the right track. Keeping it simple until your users demand more robust solution is IMHO a good idea.

If you however are looking to have more interactions like this(i.e. user does something and waits for update) you may consider using web socket or even employing tools like https://rethinkdb.com . Of course it depends on how many interactions like this you're planning to have.

How to call another worker from sidekiq worker and monitor its progress without pausing child worker

What you are looking here is something similar to Sidekiq Workflow. But this is available only on Sidekiq-Pro version, which is paid.



Related Topics



Leave a reply



Submit