Sha256: 9b1beb5d08fa713bac8d96a656cf16f512b9b0340b611a7a882ec947b57bb70b
Contents?: true
Size: 545 Bytes
Versions: 32
Compression:
Stored size: 545 Bytes
Contents
module Gitlab module Triage module Retryable MAX_RETRIES = 3 attr_accessor :tries def execute_with_retry(exception_type = StandardError) @tries = 0 until maximum_retries_reached? begin @tries += 1 result = yield break rescue exception_type raise if maximum_retries_reached? end end result end private def maximum_retries_reached? tries == MAX_RETRIES end end end end
Version data entries
32 entries across 32 versions & 1 rubygems