Increase retry count from 5 to 10. (#685)
parent
b5269b25a3
commit
170d837122
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "acme_* modules - increase number of retries from 5 to 10 to increase stability with unstable ACME endpoints (https://github.com/ansible-collections/community.crypto/pull/685)."
|
|
@ -58,13 +58,16 @@ else:
|
||||||
# -1 usually means connection problems
|
# -1 usually means connection problems
|
||||||
RETRY_STATUS_CODES = (-1, 408, 429, 503)
|
RETRY_STATUS_CODES = (-1, 408, 429, 503)
|
||||||
|
|
||||||
|
RETRY_COUNT = 10
|
||||||
|
|
||||||
|
|
||||||
def _decode_retry(module, response, info, retry_count):
|
def _decode_retry(module, response, info, retry_count):
|
||||||
if info['status'] not in RETRY_STATUS_CODES:
|
if info['status'] not in RETRY_STATUS_CODES:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if retry_count >= 5:
|
if retry_count >= RETRY_COUNT:
|
||||||
raise ACMEProtocolException(module, msg='Giving up after 5 retries', info=info, response=response)
|
raise ACMEProtocolException(
|
||||||
|
module, msg='Giving up after {retry} retries'.format(retry=RETRY_COUNT), info=info, response=response)
|
||||||
|
|
||||||
# 429 and 503 should have a Retry-After header (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After)
|
# 429 and 503 should have a Retry-After header (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue