diff --git a/lib/mongo/util/pool_manager.rb b/lib/mongo/util/pool_manager.rb index 175037e..e63e79a 100644 --- a/lib/mongo/util/pool_manager.rb +++ b/lib/mongo/util/pool_manager.rb @@ -79,15 +79,15 @@ module Mongo @refresh_required end - def close + def close(opts={}) begin if @primary_pool - @primary_pool.close + @primary_pool.close(opts) end if @secondary_pools @secondary_pools.each do |pool| - pool.close + pool.close(opts) end end diff --git a/test/replica_sets/refresh_test.rb b/test/replica_sets/refresh_test.rb index 668dbb4..ff1b8a3 100644 --- a/test/replica_sets/refresh_test.rb +++ b/test/replica_sets/refresh_test.rb @@ -101,14 +101,18 @@ class ReplicaSetRefreshTest < Test::Unit::TestCase end def test_adding_and_removing_nodes - @conn = ReplSetConnection.new([self.rs.host, self.rs.ports[0]], [self.rs.host, self.rs.ports[1]], - [self.rs.host, self.rs.ports[2]], :refresh_interval => 2, :refresh_mode => :async) + @conn = ReplSetConnection.new([self.rs.host, self.rs.ports[0]], + [self.rs.host, self.rs.ports[1]], + [self.rs.host, self.rs.ports[2]], + :refresh_interval => 2, :refresh_mode => :async) self.rs.add_node sleep(4) - @conn2 = ReplSetConnection.new([self.rs.host, self.rs.ports[0]], [self.rs.host, self.rs.ports[1]], - [self.rs.host, self.rs.ports[2]], :refresh_interval => 2, :refresh_mode => :async) + @conn2 = ReplSetConnection.new([self.rs.host, self.rs.ports[0]], + [self.rs.host, self.rs.ports[1]], + [self.rs.host, self.rs.ports[2]], + :refresh_interval => 2, :refresh_mode => :async) assert @conn2.secondaries == @conn.secondaries assert_equal 3, @conn.secondary_pools.length