Get Sidekiq job ID
Closed this issue · 4 comments
jacek213 commented
Hello,
Is there a way to somehow get sidekiq job id which corresponds to worker job responsible for image uploads?
rob-murray commented
This is a bit messy but, from Sidekiq you can query the queue with Sidekiq::Queue.new("paperclip")
.
Then the args for each job are an array, the first argument being a hash containing the class, job id, and the AJ arguments. So, you could query it something like this.
paperclip_queue = Sidekiq::Queue.new("paperclip")
# if i am search for a job for Asset model with id 451 and the paperclip attachment field of attachment
paperclip_queue.find { |job| job.args.first["arguments"] == ["Asset", 451, "attachment"] }
morgoth commented
There is no public API in delayed_paperclip to do this.
As in future delayed_paperclip will only support active job, you can take a look if it's possible there.