Reputation: 27852
Say I have a worker class that looks like this:
class BuilderWorker
include Sidekiq::Worker
sidekiq_options retry: false
def perform(order_id)
if(order_id == 5)
# How can I finish the job here? Say I want to finish it with a status of FAIL or COMPLETE.
end
end
end
I am looking for a way to finish a job from the Worker class, and when finished give it the status of FAILED. The finish should be quiet, (not raising an exception)
Upvotes: 0
Views: 1312
Reputation: 22208
With Sidekiq there are only two job results:
Your complicated scenario is called application logic and Sidekiq cannot provide it. It is up to you to write that logic.
Upvotes: 1