diff options
Diffstat (limited to 'macir.rb')
-rw-r--r-- | macir.rb | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -185,13 +185,13 @@ def wait_for_challenge_propagation(domain, challenge) threads.each(&:join) end -def acme_request_with_retries - retries ||= 0 - yield +def acme_request_with_retries(retries: 5, &block) + block.call(self) rescue Acme::Client::Error::BadNonce - retries += 1 + raise unless retries.positive? + p 'Retrying because of invalid nonce.' - retry if retries <= 5 + acme_request_with_retries(retries - 1, block) end def wait_for_challenge_validation(challenge, cert_name) |