RUBY-383 do a sync_refresh before checking out a socket
This commit is contained in:
parent
80c4cb750d
commit
06b682ec7c
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue