BigW Consortium Gitlab

Avoid autoload issue such as 'Mail::Parsers::AddressStruct'

By eager-loading the Mail gem in the Sidekiq initializer. Signed-off-by: 's avatarRémy Coutable <remy@rymai.me>
parent 44b8b77e
...@@ -23,6 +23,10 @@ Sidekiq.configure_server do |config| ...@@ -23,6 +23,10 @@ Sidekiq.configure_server do |config|
config['pool'] = Sidekiq.options[:concurrency] + 2 config['pool'] = Sidekiq.options[:concurrency] + 2
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')}")
# Avoid autoload issue such as 'Mail::Parsers::AddressStruct'
# https://github.com/mikel/mail/issues/912#issuecomment-214850355
Mail.eager_autoload!
end end
Sidekiq.configure_client do |config| Sidekiq.configure_client do |config|
......
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