2018-10-22 03:00:50 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-11-28 11:16:50 -05:00
|
|
|
module Gitlab
|
|
|
|
module SidekiqVersioning
|
|
|
|
def self.install!
|
|
|
|
# The Sidekiq client API always adds the queue to the Sidekiq queue
|
|
|
|
# list, but mail_room and gitlab-shell do not. This is only necessary
|
|
|
|
# for monitoring.
|
2021-10-04 08:11:58 -04:00
|
|
|
queues = SidekiqConfig.worker_queues
|
2017-11-28 11:16:50 -05:00
|
|
|
|
2021-10-04 08:11:58 -04:00
|
|
|
if queues.any?
|
|
|
|
Sidekiq.redis do |conn|
|
|
|
|
conn.pipelined do
|
|
|
|
queues.each do |queue|
|
|
|
|
conn.sadd('queues', queue)
|
2017-11-28 11:16:50 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2021-10-04 08:11:58 -04:00
|
|
|
rescue ::Redis::BaseError, SocketError, Errno::ENOENT, Errno::EADDRNOTAVAIL, Errno::EAFNOSUPPORT, Errno::ECONNRESET, Errno::ECONNREFUSED
|
2017-11-28 11:16:50 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|