diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2012-10-12 20:45:54 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2012-10-12 22:27:41 -0700 |
commit | c8fe0d58bcc7deb49711606566c854bf0ed7f107 (patch) | |
tree | 49f8c2b9780f58117282eff2d86e0b08cd9065bf /railties/lib/rails | |
parent | 1dc2ea8f3dfc1cce1958bd661c641ed345adf910 (diff) | |
download | rails-c8fe0d58bcc7deb49711606566c854bf0ed7f107.tar.gz rails-c8fe0d58bcc7deb49711606566c854bf0ed7f107.tar.bz2 rails-c8fe0d58bcc7deb49711606566c854bf0ed7f107.zip |
Backpedal from class-oriented config.queue. Set an actual queue instance.
Diffstat (limited to 'railties/lib/rails')
4 files changed, 5 insertions, 5 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index a7a35c2685..2bcdb3d502 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -43,7 +43,7 @@ module Rails @exceptions_app = nil @autoflush_log = true @log_formatter = ActiveSupport::Logger::SimpleFormatter.new - @queue = ActiveSupport::SynchronousQueue + @queue = ActiveSupport::SynchronousQueue.new @queue_consumer = ActiveSupport::ThreadedQueueConsumer @eager_load = nil diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index d2a402aa51..26fca503a0 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -97,8 +97,8 @@ 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.start at_exit { app.queue_consumer.shutdown } end end diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt index 74457b0efd..8aaaba628c 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt @@ -88,5 +88,5 @@ # Default the production mode queue to an synchronous queue. You will probably # want to replace this with an out-of-process queueing solution. - # config.queue = ActiveSupport::SynchronousQueue + # config.queue = ActiveSupport::SynchronousQueue.new end diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt index fe2820f64e..a5ef0cd9cd 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt @@ -35,5 +35,5 @@ config.active_support.deprecation = :stderr # Use the synchronous queue to run jobs immediately. - config.queue = ActiveSupport::SynchronousQueue + config.queue = ActiveSupport::SynchronousQueue.new end |