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
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/initializers/sidekiq.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index 6e660a8c026..7cc5e396f98 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -1,6 +1,3 @@
-require 'gitlab/current_settings'
-include Gitlab::CurrentSettings
-
# Custom Redis configuration
redis_config_hash = Gitlab::Redis.params
redis_config_hash[:namespace] = Gitlab::Redis::SIDEKIQ_NAMESPACE
@@ -32,16 +29,11 @@ Sidekiq.configure_server do |config|
end
Sidekiq::Cron::Job.load_from_hash! cron_jobs
- # allow it to fail: it may do so when create_from_defaults is executed before migrations are actually done
- begin
- throttling_enabled = current_application_settings.sidekiq_throttling_enabled
- rescue
- throttling_enabled = false
- end
+ if Gitlab::CurrentSettings.sidekiq_throttling_enabled?
+ factor = current_application_settings.sidekiq_throttling_factor
- if throttling_enabled
- { 'project_cache' => 0.1, 'pipeline' => 0.1 }.each do |queue, ratio|
- Sidekiq::Queue[queue].limit = (ratio * Sidekiq.options[:concurrency]).ceil
+ current_application_settings.sidekiq_throttling_queues.each do |queue|
+ Sidekiq::Queue[queue].limit = (factor * Sidekiq.options[:concurrency]).ceil
end
end