Commit f9b3cf17 authored by Stan Hu's avatar Stan Hu

Merge branch '3809-geo-sidekiq-pool' into 'master'

Reconfigure the Geo tracking database pool size when running as Sidekiq

Closes #3809

See merge request gitlab-org/gitlab-ee!3181
parents c2809c54 f35c0824
---
title: Reconfigure the Geo tracking database pool size when running as Sidekiq
merge_request: 3181
author:
type: fixed
......@@ -52,6 +52,14 @@ Sidekiq.configure_server do |config|
ActiveRecord::Base.establish_connection(config)
Rails.logger.debug("Connection Pool size for Sidekiq Server is now: #{ActiveRecord::Base.connection.pool.instance_variable_get('@size')}")
# EE only
if Gitlab::Geo.geo_database_configured?
Rails.configuration.geo_database['pool'] = Sidekiq.options[:concurrency]
Geo::TrackingBase.establish_connection(Rails.configuration.geo_database)
Rails.logger.debug("Connection Pool size for Sidekiq Server is now: #{Geo::TrackingBase.connection_pool.size} (Geo tracking database)")
end
# Avoid autoload issue such as 'Mail::Parsers::AddressStruct'
# https://github.com/mikel/mail/issues/912#issuecomment-214850355
Mail.eager_autoload!
......
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