aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2012-10-13 09:54:34 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2012-10-13 09:54:34 -0700
commit1fd89260566eae1b8d3531bf83233eb18c27ab3d (patch)
tree93dd1a755b5f913cf080768136c527b9a262f99f /railties/lib/rails
parentc8fe0d58bcc7deb49711606566c854bf0ed7f107 (diff)
downloadrails-1fd89260566eae1b8d3531bf83233eb18c27ab3d.tar.gz
rails-1fd89260566eae1b8d3531bf83233eb18c27ab3d.tar.bz2
rails-1fd89260566eae1b8d3531bf83233eb18c27ab3d.zip
Test that a Rails.queue consumer is automatically started in production
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/application/configuration.rb2
-rw-r--r--railties/lib/rails/application/finisher.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb
index 2bcdb3d502..9b89d7094c 100644
--- a/railties/lib/rails/application/configuration.rb
+++ b/railties/lib/rails/application/configuration.rb
@@ -44,7 +44,7 @@ module Rails
@autoflush_log = true
@log_formatter = ActiveSupport::Logger::SimpleFormatter.new
@queue = ActiveSupport::SynchronousQueue.new
- @queue_consumer = ActiveSupport::ThreadedQueueConsumer
+ @queue_consumer = nil
@eager_load = nil
@assets = ActiveSupport::OrderedOptions.new
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb
index 26fca503a0..4a15a36ba9 100644
--- a/railties/lib/rails/application/finisher.rb
+++ b/railties/lib/rails/application/finisher.rb
@@ -98,7 +98,8 @@ module Rails
initializer :activate_queue_consumer do |app|
if config.queue.class == ActiveSupport::Queue
- app.queue_consumer = config.queue_consumer.start
+ app.queue_consumer = config.queue_consumer || config.queue.consumer
+ app.queue_consumer.start
at_exit { app.queue_consumer.shutdown }
end
end