checking if there is an existing Sidekiq job for a given object ID

31 Views Asked by At

I have a Sidekiq worker that takes an object instance ID and it uses the "default" queue:

  class ExampleWorker
    include Sidekiq::Worker

    def perform(id)
      instance = Record.find_by(id: id)
      (...)

How can I check If there is an exisiting Job for a given instance.id before calling this worker with ExampleWorker.perform_async(inst.id)

it's probably worth mentioning that it's the Sidekiq Pro version being used.

0

There are 0 best solutions below