debian-mirror-gitlab/lib/gitlab/sidekiq_status/client_middleware.rb

16 lines
428 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
module Gitlab
module SidekiqStatus
class ClientMiddleware
def call(_, job, _, _)
status_expiration = job['status_expiration'] || Gitlab::SidekiqStatus::DEFAULT_EXPIRATION
2022-01-26 12:08:38 +05:30
value = job['status_expiration'] ? 2 : Gitlab::SidekiqStatus::DEFAULT_VALUE
2017-08-17 22:00:37 +05:30
2022-01-26 12:08:38 +05:30
Gitlab::SidekiqStatus.set(job['jid'], status_expiration, value: value)
2017-08-17 22:00:37 +05:30
yield
end
end
end
end