1
0
Fork 0
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:
Mike Perham 2016-10-17 10:54:46 -07:00
parent 3b538c66e9
commit 4b3d5edd18

View file

@ -63,6 +63,10 @@ module Sidekiq
# 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)
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
Sidekiq.options[:reloader] = Sidekiq::Rails::Reloader.new
end