2017-08-21 07:05:01 -04:00
|
|
|
##
|
2016-10-21 12:13:41 -04:00
|
|
|
# Concern for setting Sidekiq settings for the various CI pipeline workers.
|
2017-08-21 07:05:01 -04:00
|
|
|
#
|
2016-10-21 12:13:41 -04:00
|
|
|
module PipelineQueue
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
2017-08-21 07:49:57 -04:00
|
|
|
sidekiq_options queue: 'pipeline_default'
|
2017-08-21 07:05:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
class_methods do
|
2017-08-21 07:49:57 -04:00
|
|
|
def enqueue_in(group:)
|
|
|
|
raise ArgumentError, 'Unspecified queue group!' if group.empty?
|
2017-08-21 07:05:01 -04:00
|
|
|
|
2017-08-21 07:49:57 -04:00
|
|
|
sidekiq_options queue: "pipeline_#{group}"
|
2017-08-21 07:05:01 -04:00
|
|
|
end
|
2016-10-21 12:13:41 -04:00
|
|
|
end
|
|
|
|
end
|