debian-mirror-gitlab/lib/gitlab/sidekiq_status/client_middleware.rb
2022-01-26 12:08:38 +05:30

15 lines
428 B
Ruby

# frozen_string_literal: true
module Gitlab
module SidekiqStatus
class ClientMiddleware
def call(_, job, _, _)
status_expiration = job['status_expiration'] || Gitlab::SidekiqStatus::DEFAULT_EXPIRATION
value = job['status_expiration'] ? 2 : Gitlab::SidekiqStatus::DEFAULT_VALUE
Gitlab::SidekiqStatus.set(job['jid'], status_expiration, value: value)
yield
end
end
end
end