diff options
author | Gabriel Mazetto <gabriel@gitlab.com> | 2015-12-10 15:45:36 -0200 |
---|---|---|
committer | Gabriel Mazetto <gabriel@gitlab.com> | 2015-12-10 17:18:03 -0200 |
commit | 3e5b24d46a7fe904a5f934a54dafbb05a01f837b (patch) | |
tree | 476e7887df75c95781a8ca2f00d6f06d9056e069 /config | |
parent | b20f677baa94aaea1dbc3437c51abbfd6f0e1548 (diff) | |
download | gitlab-ce-3e5b24d46a7fe904a5f934a54dafbb05a01f837b.tar.gz |
Upgraded Sidekiq to 4.xfeature/sidekiq-4
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/sidekiq.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 6e5701e33da..2e3a71912ef 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -23,6 +23,14 @@ Sidekiq.configure_server do |config| if File.exists?(schedule_file) Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file) end + + # Database pool should be at least `sidekiq_concurrency` + 2 + # For more info, see: https://github.com/mperham/sidekiq/blob/master/4.0-Upgrade.md + config = ActiveRecord::Base.configurations[Rails.env] || + Rails.application.config.database_configuration[Rails.env] + config['pool'] = Sidekiq.options[:concurrency] + 2 + ActiveRecord::Base.establish_connection(config) + Rails.logger.debug("Connection Pool size for Sidekiq Server is now: #{ActiveRecord::Base.connection.pool.instance_variable_get('@size')}") end Sidekiq.configure_client do |config| |