aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2012-04-27 18:00:58 -0400
committerPrem Sichanugrist <s@sikachu.com>2012-04-27 18:22:25 -0400
commit4531ba74938985bd2343b27d1a30d099d5975b02 (patch)
treefd2d4c6f7ef6446639c7e2655f98c11cca7d05b4 /railties/lib
parent90e90d61cbf89aff779062cc819f2e5e71eb0f5c (diff)
downloadrails-4531ba74938985bd2343b27d1a30d099d5975b02.tar.gz
rails-4531ba74938985bd2343b27d1a30d099d5975b02.tar.bz2
rails-4531ba74938985bd2343b27d1a30d099d5975b02.zip
Log the exception from the ThreadConsumer
This will make sure you know when there's an exception occur.
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/queueing.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails/queueing.rb b/railties/lib/rails/queueing.rb
index 516447315f..fb5519f827 100644
--- a/railties/lib/rails/queueing.rb
+++ b/railties/lib/rails/queueing.rb
@@ -34,7 +34,11 @@ module Rails
def start
@thread = Thread.new do
while job = @queue.pop
- job.run
+ begin
+ job.run
+ rescue Exception => e
+ Rails.logger.error "Job Error: #{e.message}\n#{e.backtrace.join("\n")}"
+ end
end
end
self