summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2018-09-12 11:53:42 +0300
committerValery Sizov <valery@gitlab.com>2018-10-03 18:10:46 +0300
commit34687cf05deadccdd6b4b321c71d276ee0e72f49 (patch)
tree978d3815ca0a546354475384bbc4eef5a65bdcfe /config
parent4586d77c85647063675108b0dcdcfebed0c890ca (diff)
downloadgitlab-ce-34687cf05deadccdd6b4b321c71d276ee0e72f49.tar.gz
Add reliable fetcher for Sidekiqadd_reliable_fetcher
Diffstat (limited to 'config')
-rw-r--r--config/initializers/sidekiq.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index 6c1079faad1..bc6b7aed6aa 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -40,6 +40,10 @@ Sidekiq.configure_server do |config|
ActiveRecord::Base.clear_all_connections!
end
+ if Feature.enabled?(:gitlab_sidekiq_reliable_fetcher)
+ Sidekiq::ReliableFetcher.setup_reliable_fetch!(config)
+ end
+
# Sidekiq-cron: load recurring jobs from gitlab.yml
# UGLY Hack to get nested hash from settingslogic
cron_jobs = JSON.parse(Gitlab.config.cron_jobs.to_json)
@@ -57,10 +61,10 @@ Sidekiq.configure_server do |config|
Gitlab::SidekiqVersioning.install!
- config = Gitlab::Database.config ||
+ db_config = Gitlab::Database.config ||
Rails.application.config.database_configuration[Rails.env]
- config['pool'] = Sidekiq.options[:concurrency]
- ActiveRecord::Base.establish_connection(config)
+ db_config['pool'] = Sidekiq.options[:concurrency]
+ ActiveRecord::Base.establish_connection(db_config)
Rails.logger.debug("Connection Pool size for Sidekiq Server is now: #{ActiveRecord::Base.connection.pool.instance_variable_get('@size')}")
# Avoid autoload issue such as 'Mail::Parsers::AddressStruct'