diff options
Diffstat (limited to 'railties/lib/rails/application/finisher.rb')
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index d2a402aa51..c520f7af9d 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -72,7 +72,7 @@ module Rails # Set app reload just after the finisher hook to ensure # paths added in the hook are still loaded. - initializer :set_clear_dependencies_hook, :group => :all do + initializer :set_clear_dependencies_hook, group: :all do callback = lambda do ActiveSupport::DescendantsTracker.clear ActiveSupport::Dependencies.clear @@ -83,7 +83,7 @@ module Rails self.reloaders << reloader # We need to set a to_prepare callback regardless of the reloader result, i.e. # models should be reloaded if any of the reloaders (i18n, routes) were updated. - ActionDispatch::Reloader.to_prepare(:prepend => true){ reloader.execute } + ActionDispatch::Reloader.to_prepare(prepend: true){ reloader.execute } else ActionDispatch::Reloader.to_cleanup(&callback) end @@ -97,8 +97,9 @@ module Rails end initializer :activate_queue_consumer do |app| - if config.queue == ActiveSupport::Queue - app.queue_consumer = config.queue_consumer.start(app.queue, {logger: Rails.logger}) + if config.queue.class == ActiveSupport::Queue + app.queue_consumer = config.queue_consumer || config.queue.consumer + app.queue_consumer.start at_exit { app.queue_consumer.shutdown } end end |