Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
comandeo-mongo committed Feb 9, 2024
1 parent 908f150 commit ba93e1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions lib/mongo/server/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,10 @@ def connect!(context = nil)
opts = ssl_options.merge(
connection_address: address,
connection_generation: generation,
pipe: options[:pipe]
).tap do |o|
o[:connect_timeout]
end
address.socket(socket_timeout, ssl_options.merge(
connection_address: address, connection_generation: generation, pipe: options[:pipe]))
pipe: options[:pipe],
connect_timeout: context&.remaining_timeout_sec
)
address.socket(socket_timeout, opts)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/mongo/server/connection_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ def get_connection(pid, connection_global_id)
# @raise [ Timeout::Error ] If the connection pool is at maximum size
# and remains so for longer than the wait timeout.
def retrieve_and_connect_connection(connection_global_id, context = nil)
deadline = Utils.monotonic_time + wait_timeout(context.remaining_timeout_sec)
deadline = Utils.monotonic_time + wait_timeout(context&.remaining_timeout_sec)
connection = nil

@lock.synchronize do
Expand Down

0 comments on commit ba93e1e

Please sign in to comment.