debian-mirror-gitlab/app/workers/concerns/dedicated_sidekiq_queue.rb
2016-11-03 12:29:30 +05:30

9 lines
258 B
Ruby

# Concern that sets the queue of a Sidekiq worker based on the worker's class
# name/namespace.
module DedicatedSidekiqQueue
extend ActiveSupport::Concern
included do
sidekiq_options queue: name.sub(/Worker\z/, '').underscore.tr('/', '_')
end
end