RUBY-386 extend ismaster timeout to Connection
This commit is contained in:
parent
c308f9b025
commit
8fd89eb2a4
@ -615,7 +615,13 @@ module Mongo
|
||||
socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
|
||||
end
|
||||
|
||||
config = self['admin'].command({:ismaster => 1}, :socket => socket)
|
||||
if @connect_timeout
|
||||
Mongo::TimeoutHandler.timeout(@connect_timeout, OperationTimeout) do
|
||||
config = self['admin'].command({:ismaster => 1}, :socket => socket)
|
||||
end
|
||||
else
|
||||
config = self['admin'].command({:ismaster => 1}, :socket => socket)
|
||||
end
|
||||
rescue OperationFailure, SocketError, SystemCallError, IOError => ex
|
||||
close
|
||||
ensure
|
||||
|
Loading…
Reference in New Issue
Block a user