mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Don't use the Reloader API at all when caching classes, #3154
This commit is contained in:
parent
3b538c66e9
commit
4b3d5edd18
1 changed files with 4 additions and 0 deletions
|
@ -63,6 +63,10 @@ module Sidekiq
|
||||||
# the ActiveRecord middleware so make sure it's not in the chain already.
|
# the ActiveRecord middleware so make sure it's not in the chain already.
|
||||||
if defined?(Sidekiq::Middleware::Server::ActiveRecord) && Sidekiq.server_middleware.exists?(Sidekiq::Middleware::Server::ActiveRecord)
|
if defined?(Sidekiq::Middleware::Server::ActiveRecord) && Sidekiq.server_middleware.exists?(Sidekiq::Middleware::Server::ActiveRecord)
|
||||||
raise ArgumentError, "You are using the Sidekiq ActiveRecord middleware and the new Rails 5 reloader which are incompatible. Please remove the ActiveRecord middleware from your Sidekiq middleware configuration."
|
raise ArgumentError, "You are using the Sidekiq ActiveRecord middleware and the new Rails 5 reloader which are incompatible. Please remove the ActiveRecord middleware from your Sidekiq middleware configuration."
|
||||||
|
elsif ::Rails.application.config.cache_classes
|
||||||
|
# The reloader API has proven to be troublesome under load in production.
|
||||||
|
# We won't use it at all when classes are cached, see #3154
|
||||||
|
Sidekiq.logger.debug { "Autoload disabled in #{::Rails.env}, Sidekiq will not reload changed classes" }
|
||||||
else
|
else
|
||||||
Sidekiq.options[:reloader] = Sidekiq::Rails::Reloader.new
|
Sidekiq.options[:reloader] = Sidekiq::Rails::Reloader.new
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue