summaryrefslogtreecommitdiff
path: root/app/workers/concerns/pipeline_queue.rb
blob: ddf45b91345c8be82f9aa285664b2b817d6fdc20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
##
# Concern for setting Sidekiq settings for the various CI pipeline workers.
#
module PipelineQueue
  extend ActiveSupport::Concern

  included do
    sidekiq_options queue: 'pipeline_default'
  end

  class_methods do
    def enqueue_in(group:)
      raise ArgumentError, 'Unspecified queue group!' if group.empty?

      sidekiq_options queue: "pipeline_#{group}"
    end
  end
end