diff --git a/src/main.py b/src/main.py index da63f89..f3e6cb7 100644 --- a/src/main.py +++ b/src/main.py @@ -430,6 +430,11 @@ async def knative_request( ) if retry and result.status_code == 503: + if 'Retry-After' in result.headers: + delay = int(result.headers['Retry-After']) + logging.info("Waiting %d seconds before retrying nextVisit %s...", delay, info) + await asyncio.sleep(delay) + logging.info( f"retry after status code {result.status_code} for nextVisit {info}" )