RUBY-383 do a sync_refresh before checking out a socket

This commit is contained in:
Kyle Banker 2011-12-06 14:38:56 -05:00
parent 80c4cb750d
commit 06b682ec7c
1 changed files with 11 additions and 2 deletions

View File

@ -308,7 +308,12 @@ module Mongo
# Note that @read_pool might point to the primary pool # Note that @read_pool might point to the primary pool
# if no read pool has been defined. # if no read pool has been defined.
def checkout_reader def checkout_reader
connect unless connected? if connected?
sync_refresh
else
connect
end
begin begin
socket = get_socket_from_pool(self.read_pool) socket = get_socket_from_pool(self.read_pool)
@ -330,7 +335,11 @@ module Mongo
# Checkout a socket for writing (i.e., a primary node). # Checkout a socket for writing (i.e., a primary node).
def checkout_writer def checkout_writer
connect unless connected? if connected?
sync_refresh
else
connect
end
begin begin
socket = get_socket_from_pool(self.primary_pool) socket = get_socket_from_pool(self.primary_pool)