The bot now retries upon HTTP errors
This commit is contained in:
parent
9052f6595c
commit
92c36cb6e8
|
@ -82,7 +82,7 @@ def check_response(
|
||||||
if isinstance(value, httpx.RequestError):
|
if isinstance(value, httpx.RequestError):
|
||||||
if verbose:
|
if verbose:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"A fatal HTTP exception occurred while sending request to {value.request.url!r}, details follow:"
|
f"A fatal HTTP exception occurred while sending request to {value.request.url!r}, details follow: "
|
||||||
f"{type(value).__name__} -> {value}"
|
f"{type(value).__name__} -> {value}"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
@ -259,7 +259,7 @@ async def main(arguments: argparse.Namespace) -> int:
|
||||||
result := await send_request(client, "get", GET_BOOKABLE_LESSONS_URL.format(arguments.tax_code)),
|
result := await send_request(client, "get", GET_BOOKABLE_LESSONS_URL.format(arguments.tax_code)),
|
||||||
arguments.verbose,
|
arguments.verbose,
|
||||||
):
|
):
|
||||||
return -1
|
continue # Tries again
|
||||||
else:
|
else:
|
||||||
entries = []
|
entries = []
|
||||||
for chunk in json.loads(result.text):
|
for chunk in json.loads(result.text):
|
||||||
|
|
Loading…
Reference in New Issue