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:
parent
96e713b02b
commit
aebbd4bb4d
2 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue