1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Only configure reloader/executor in server mode, not necessary in client mode, fixes #3275

This commit is contained in:
Mike Perham 2016-12-12 09:39:12 -08:00
parent 9ce75f9b19
commit b427f34331

View file

@ -52,12 +52,15 @@ module Sidekiq
Sidekiq.hook_rails!
end
config.after_initialize do
# This hook happens after all initializers are run, just before returning
# from config/environment.rb back to sidekiq/cli.rb.
# We have to add the reloader after initialize to see if cache_classes has
# been turned on.
#
# This hook happens after all initialziers are run, just before returning
# from config/environment.rb back to sidekiq/cli.rb.
config.after_initialize do
# None of this matters on the client-side, only within the Sidekiq process itself.
#
Sidekiq.configure_server do |_|
if ::Rails::VERSION::MAJOR >= 5
# The reloader also takes care of ActiveRecord but is incompatible with
# the ActiveRecord middleware so make sure it's not in the chain already.
@ -75,6 +78,7 @@ module Sidekiq
end
end
end
end
class Executor
def initialize(app = ::Rails.application)