Sha256: 8135e5129182bfa1235597dbc8807f44f7b2af9df3a51f206b8f6bccc644bc6c
Contents?: true
Size: 578 Bytes
Versions: 10
Compression:
Stored size: 578 Bytes
Contents
module PactBroker module Client class Retry def self.until_true options = {} max_tries = options.fetch(:times, 3) tries = 0 while true begin return yield rescue StandardError => e tries += 1 $stderr.puts "Error publishing pact - #{e.message}, attempt #{tries} of #{max_tries}" sleep options raise e if max_tries == tries end end end def self.sleep options Kernel.sleep options.fetch(:sleep, 5) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems