mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Refactor Rails 5 integration, per @matthewd
This commit is contained in:
parent
5fd622e666
commit
871626c9b3
2 changed files with 6 additions and 6 deletions
|
@ -227,7 +227,7 @@ module Sidekiq
|
|||
require 'sidekiq/rails'
|
||||
require File.expand_path("#{options[:require]}/config/environment.rb")
|
||||
::Rails.application.eager_load!
|
||||
else
|
||||
elsif ::Rails::VERSION::MAJOR == 4
|
||||
# Painful contortions, see 1791 for discussion
|
||||
require File.expand_path("#{options[:require]}/config/application.rb")
|
||||
::Rails::Application.initializer "sidekiq.eager_load" do
|
||||
|
@ -235,11 +235,11 @@ module Sidekiq
|
|||
end
|
||||
require 'sidekiq/rails'
|
||||
require File.expand_path("#{options[:require]}/config/environment.rb")
|
||||
|
||||
if ::Rails::VERSION::MAJOR > 4 && !::Rails.application.config.cache_classes
|
||||
else
|
||||
require 'sidekiq/rails'
|
||||
require File.expand_path("#{options[:require]}/config/environment.rb")
|
||||
Sidekiq.options[:reloader] = Sidekiq::Rails::Reloader.new
|
||||
end
|
||||
end
|
||||
options[:tag] ||= default_tag
|
||||
else
|
||||
require options[:require]
|
||||
|
|
|
@ -38,7 +38,7 @@ module Sidekiq
|
|||
|
||||
class Reloader
|
||||
def initialize(app = ::Rails.application)
|
||||
Sidekiq.logger.debug "Enabling Rails 5+ live code reloading, so hot!"
|
||||
Sidekiq.logger.debug "Enabling Rails 5+ live code reloading, so hot!" unless app.config.cache_classes
|
||||
@app = app
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue