Commit 27afeead authored by Alex Kalderimis's avatar Alex Kalderimis

Merge branch 'fix-sidekiq-queue-migration-in-production' into 'master'

Fix sidekiq:migrate_jobs tasks in production mode

See merge request gitlab-org/gitlab!64414
parents 15ee1a41 9971da5d
# frozen_string_literal: true
return if Rails.env.production?
namespace :gitlab do
namespace :sidekiq do
def write_yaml(path, banner, object)
......@@ -31,9 +29,13 @@ namespace :gitlab do
end
end
task :not_production do
raise 'This task cannot be run in the production environment' if Rails.env.production?
end
namespace :all_queues_yml do
desc 'GitLab | Sidekiq | Generate all_queues.yml based on worker definitions'
task generate: :environment do
task generate: ['gitlab:sidekiq:not_production', :environment] do
banner = <<~BANNER
# This file is generated automatically by
# bin/rake gitlab:sidekiq:all_queues_yml:generate
......@@ -51,7 +53,7 @@ namespace :gitlab do
end
desc 'GitLab | Sidekiq | Validate that all_queues.yml matches worker definitions'
task check: :environment do
task check: ['gitlab:sidekiq:not_production', :environment] do
if Gitlab::SidekiqConfig.all_queues_yml_outdated?
raise <<~MSG
Changes in worker queues found, please update the metadata by running:
......@@ -70,7 +72,7 @@ namespace :gitlab do
namespace :sidekiq_queues_yml do
desc 'GitLab | Sidekiq | Generate sidekiq_queues.yml based on worker definitions'
task generate: :environment do
task generate: ['gitlab:sidekiq:not_production', :environment] do
banner = <<~BANNER
# This file is generated automatically by
# bin/rake gitlab:sidekiq:sidekiq_queues_yml:generate
......@@ -104,7 +106,7 @@ namespace :gitlab do
end
desc 'GitLab | Sidekiq | Validate that sidekiq_queues.yml matches worker definitions'
task check: :environment do
task check: ['gitlab:sidekiq:not_production', :environment] do
if Gitlab::SidekiqConfig.sidekiq_queues_yml_outdated?
raise <<~MSG
Changes in worker queues found, please update the metadata by running:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment