diff options
author | Hendrik Jäger <gitcommit@henk.geekmail.org> | 2024-02-03 20:48:43 +0100 |
---|---|---|
committer | Hendrik Jäger <gitcommit@henk.geekmail.org> | 2024-02-03 21:43:09 +0100 |
commit | 947dc02ce2a783be0d3121bbee48498639d3a758 (patch) | |
tree | 8f7f5f2e5f15d79139e0e9c29a5fa9a055d3b836 /macir.rb | |
parent | 8501b85e09c02f9bd18e8f73453a327ddf7c12e1 (diff) |
Diffstat (limited to 'macir.rb')
-rw-r--r-- | macir.rb | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -185,13 +185,14 @@ 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) + p "Retries: #{retries}" + 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: retries - 1, &block) end def wait_for_challenge_validation(challenge, cert_name) |