1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

No need to defensively work jobs in another thread

This commit is contained in:
Jeremy Kemper 2012-09-18 15:22:13 -07:00
parent 96e713b02b
commit aebbd4bb4d
2 changed files with 2 additions and 2 deletions

View file

@ -110,7 +110,7 @@ module ActiveSupport
end
def drain
Thread.new { run(@queue.pop) until @queue.empty? }.join
run(@queue.pop) until @queue.empty?
end
def consume

View file

@ -97,6 +97,6 @@ class TestQueueTest < ActiveSupport::TestCase
assert @queue.empty?
assert job.ran?, "The job runs synchronously when the queue is drained"
assert_not_equal job.thread_id, Thread.current.object_id
assert_equal job.thread_id, Thread.current.object_id
end
end