diff options
author | Rémy Coutable <remy@rymai.me> | 2016-06-20 12:43:29 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-06-20 12:43:29 +0200 |
commit | 3cb1e96ef6b55026a3a6d7fbb3b95ade341b0709 (patch) | |
tree | 1b2439ee9f7651746f5c11d4d0aeaed6327fbd63 /config/initializers | |
parent | 44b8b77e02423ce97f9abe80e0335f4f4c453c83 (diff) | |
download | gitlab-ce-3cb1e96ef6b55026a3a6d7fbb3b95ade341b0709.tar.gz |
Avoid autoload issue such as 'Mail::Parsers::AddressStruct'18810-nameerror-uninitialized-constant-mail-parsers-addressstruct
By eager-loading the Mail gem in the Sidekiq initializer.
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/sidekiq.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index f1eec674888..7a2b9a7f6c1 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -23,6 +23,10 @@ Sidekiq.configure_server do |config| 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')}") + + # Avoid autoload issue such as 'Mail::Parsers::AddressStruct' + # https://github.com/mikel/mail/issues/912#issuecomment-214850355 + Mail.eager_autoload! end Sidekiq.configure_client do |config| |