Commit f35c0824 authored by Nick Thomas's avatar Nick Thomas

Reconfigure the Geo tracking database pool size when running as Sidekiq

parent c2809c54
---
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| ...@@ -52,6 +52,14 @@ Sidekiq.configure_server do |config|
ActiveRecord::Base.establish_connection(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')}") 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' # Avoid autoload issue such as 'Mail::Parsers::AddressStruct'
# https://github.com/mikel/mail/issues/912#issuecomment-214850355 # https://github.com/mikel/mail/issues/912#issuecomment-214850355
Mail.eager_autoload! 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