mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Force eager loading of all code when running non-development in Rails 4/5, fixes #3203.
This commit is contained in:
parent
6f18a5b15e
commit
d7c752844e
2 changed files with 8 additions and 1 deletions
|
@ -1,5 +1,10 @@
|
|||
# Sidekiq Changes
|
||||
|
||||
4.2.5
|
||||
-----------
|
||||
|
||||
- Re-enable eager loading of all code when running non-development Rails 5. [#3203]
|
||||
|
||||
4.2.4
|
||||
-----------
|
||||
|
||||
|
|
|
@ -229,8 +229,9 @@ module Sidekiq
|
|||
require 'sidekiq/rails'
|
||||
require File.expand_path("#{options[:require]}/config/environment.rb")
|
||||
::Rails.application.eager_load!
|
||||
elsif ::Rails::VERSION::MAJOR == 4
|
||||
elsif ::Rails::VERSION::MAJOR >= 4 && environment != 'development'
|
||||
# Painful contortions, see 1791 for discussion
|
||||
# No autoloading, we want to force eager load for everything.
|
||||
require File.expand_path("#{options[:require]}/config/application.rb")
|
||||
::Rails::Application.initializer "sidekiq.eager_load" do
|
||||
::Rails.application.config.eager_load = true
|
||||
|
@ -238,6 +239,7 @@ module Sidekiq
|
|||
require 'sidekiq/rails'
|
||||
require File.expand_path("#{options[:require]}/config/environment.rb")
|
||||
else
|
||||
# Rails 5+ && development mode, use Reloader
|
||||
require 'sidekiq/rails'
|
||||
require File.expand_path("#{options[:require]}/config/environment.rb")
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue