module WinRM::Shells::Retryable

Shell mixin for retrying an operation

Constants

RETRYABLE_EXCEPTIONS

Public Instance Methods

retryable(retries, delay) { || ... } click to toggle source

Retries the operation a specified number of times with a delay between @param retries [Integer] The number of times to retry @param delay [Integer] The number of seconds to wait between retry attempts

# File lib/winrm/shells/retryable.rb, line 34
def retryable(retries, delay)
  yield
rescue *RETRYABLE_EXCEPTIONS.call
  raise unless (retries -= 1) > 0

  sleep(delay)
  retry
end