Skip to content

Commit

Permalink
Use thread down
Browse files Browse the repository at this point in the history
  • Loading branch information
hirocaster committed Mar 10, 2016
1 parent 65c793a commit ccdf003
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/active_record/slave/model_spec.rb
Expand Up @@ -27,15 +27,15 @@

describe "multi thread" do
before do
Parallel.each((0..99).to_a, :in_threads => 8) do |dummy|
Parallel.each((0..99).to_a, :in_threads => 2) do |dummy|
User.connection_pool.with_connection do
User.create name: "test#{dummy}"
end
end
end

it "returns writed models" do
Parallel.each((0..14).to_a, :in_threads => 8) do |dummy|
Parallel.each((0..14).to_a, :in_threads => 2) do |dummy|
User.slave_for.connection_pool.with_connection do
expect(User.slave_for.all.count).to eq 100
end
Expand Down

0 comments on commit ccdf003

Please sign in to comment.