debian-mirror-gitlab/vendor/gems/sidekiq-reliable-fetch/tests/interruption/worker.rb
2023-06-20 00:43:36 +05:30

15 lines
278 B
Ruby

# frozen_string_literal: true
class RetryTestWorker
include Sidekiq::Worker
def perform(signal = 'KILL', wait_seconds = 1)
Sidekiq.redis do |redis|
redis.incr('times_has_been_run')
end
Process.kill(signal, Process.pid)
sleep wait_seconds
end
end