lib/pitchfork/refork_condition.rb in pitchfork-0.10.0 vs lib/pitchfork/refork_condition.rb in pitchfork-0.11.0

- old
+ new

@@ -1,9 +1,15 @@ # frozen_string_literal: true module Pitchfork module ReforkCondition + @backoff_delay = 10.0 + + class << self + attr_accessor :backoff_delay + end + class RequestsCount def initialize(request_counts) @limits = request_counts @backoff_until = nil end @@ -29,10 +35,10 @@ @backoff_until = nil false end end - def backoff!(delay = 10.0) + def backoff!(delay = ReforkCondition.backoff_delay) @backoff_until = Pitchfork.time_now + delay end end end end