I am in middle of running a sidekiq job and let's say for some reason an error occurs. For that particular error we don't want to update the retry_count of the sidekiq job but want to trigger the retry. Is there any particular way to do it?.
I tried deleting one of the job and modifying the items to not update retry queue and push it again. However it causes inconsistency as when sidekiq realises there was a error the deleted job comes up with updated retry count.
I am doing all this in middleware as there is where sidekiq properties are accessible.
def call(worker, item, queue)
begin
job = get_job_from_sidekiq(item.queue)
# say some error occurs
rescue HandleThisError
job["retry_count"] = [msg["retry_count"].to_i - 1,0].max
end
end
Basically avoiding the retry count to increase. This doesn't seem to be working do we have any work around for it?