debian-mirror-gitlab/vendor/gems/sidekiq-reliable-fetch/tests/interruption/worker.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
278 B
Ruby
Raw Normal View History

2023-06-20 00:43:36 +05:30
# 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