Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/sidekiq_config.rb')
-rw-r--r--lib/gitlab/sidekiq_config.rb17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/gitlab/sidekiq_config.rb b/lib/gitlab/sidekiq_config.rb
index 633291dcdf3..78d45b5f3f0 100644
--- a/lib/gitlab/sidekiq_config.rb
+++ b/lib/gitlab/sidekiq_config.rb
@@ -13,10 +13,17 @@ module Gitlab
(EE_QUEUE_CONFIG_PATH if Gitlab.ee?)
].compact.freeze
- DEFAULT_WORKERS = [
- DummyWorker.new('default', weight: 1, tags: []),
- DummyWorker.new('mailers', weight: 2, tags: [])
- ].map { |worker| Gitlab::SidekiqConfig::Worker.new(worker, ee: false) }.freeze
+ # This maps workers not in our application code to queues. We need
+ # these queues in our YAML files to ensure we don't accidentally
+ # miss jobs from these queues.
+ #
+ # The default queue should be unused, which is why it maps to an
+ # invalid class name. We keep it in the YAML file for safety, just
+ # in case anything does get scheduled to run there.
+ DEFAULT_WORKERS = {
+ '_' => DummyWorker.new('default', weight: 1, tags: []),
+ 'ActionMailer::MailDeliveryJob' => DummyWorker.new('mailers', feature_category: :issue_tracking, urgency: 'low', weight: 2, tags: [])
+ }.transform_values { |worker| Gitlab::SidekiqConfig::Worker.new(worker, ee: false) }.freeze
class << self
include Gitlab::SidekiqConfig::CliMethods
@@ -40,7 +47,7 @@ module Gitlab
def workers
@workers ||= begin
result = []
- result.concat(DEFAULT_WORKERS)
+ result.concat(DEFAULT_WORKERS.values)
result.concat(find_workers(Rails.root.join('app', 'workers'), ee: false))
if Gitlab.ee?