Method: Mongo::Retryable#read_with_one_retry

Defined in:
lib/mongo/retryable.rb

#read_with_one_retryResult

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Note:

This only retries read operations on socket errors.

Execute a read operation with a single retry.

Examples:

Execute the read.

read_with_one_retry do
  ...
end

Parameters:

  • block (Proc)

    The block to execute.

Returns:

  • (Result)

    The result of the operation.

Since:

  • 2.2.6



77
78
79
80
81
# File 'lib/mongo/retryable.rb', line 77

def read_with_one_retry
  yield
rescue Error::SocketError, Error::SocketTimeoutError
  yield
end