2019-08-20 15:25:04 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module SidekiqMiddleware
|
|
|
|
class Monitor
|
|
|
|
def call(worker, job, queue)
|
|
|
|
Gitlab::SidekiqMonitor.instance.within_job(job['jid'], queue) do
|
|
|
|
yield
|
|
|
|
end
|
2019-08-21 10:03:42 +00:00
|
|
|
rescue Gitlab::SidekiqMonitor::CancelledError
|
|
|
|
# ignore retries
|
|
|
|
raise Sidekiq::JobRetry::Skip
|
2019-08-20 15:25:04 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|