Commit a46eb4fe authored by Adrien Dorsaz's avatar Adrien Dorsaz
Browse files

when we have to wait, parse Retry-After header as float if possible

So, if this header is not a valid float number, we can
fallback to the default number of seconds.
parent 7a0fa403
......@@ -324,9 +324,9 @@ def get_crt(config, log=LOGGER):
http_response, order = _send_signed_request(order_location, "")
if order["status"] == "processing":
if http_response.headers["Retry-After"]:
time.sleep(http_response.headers["Retry-After"])
else:
try:
time.sleep(float(http_response.headers["Retry-After"]))
except (OverflowError, ValueError, TypeError):
time.sleep(2)
elif order["status"] == "valid":
log.info("Order finalized!")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment