Wrap the logic with Timeout::timeoutand turn off retries if you do not want the job to repeat after a timeout.
class RunsTooLongWorker
include Sidekiq::Worker
sidekiq_options :retry => false
def perform(*args)
Timeout::timeout(2.hours) do
end
end
end
source
share