Permalink
Browse files

No need to defensively work jobs in another thread

  • Loading branch information...
1 parent 96e713b commit aebbd4bb4d2bb5a461d5ec70dd27e5cb832d6869 @jeremy jeremy committed Sep 18, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 activesupport/lib/active_support/queueing.rb
  2. +1 −1 activesupport/test/queueing/test_queue_test.rb
@@ -110,7 +110,7 @@ def shutdown
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 @@ def test_drain
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

0 comments on commit aebbd4b

Please sign in to comment.