mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-10 07:11:00 +00:00
Don't fail ping on URLError
This commit is contained in:
parent
16f1475f80
commit
364bec2872
@ -6,7 +6,7 @@ from enum import Enum
|
|||||||
from functools import wraps
|
from functools import wraps
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from typing import Any, Callable, Optional
|
from typing import Any, Callable, Optional
|
||||||
from urllib.error import HTTPError
|
from urllib.error import HTTPError, URLError
|
||||||
from urllib.request import Request, urlopen
|
from urllib.request import Request, urlopen
|
||||||
|
|
||||||
CI = os.getenv("CI")
|
CI = os.getenv("CI")
|
||||||
@ -160,6 +160,8 @@ def ping_and_check_content(url: str, callback: Callable[[str], Optional[str]]):
|
|||||||
except HTTPError as exc:
|
except HTTPError as exc:
|
||||||
if exc.code not in (404, 502):
|
if exc.code not in (404, 502):
|
||||||
raise
|
raise
|
||||||
|
except URLError:
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
text: str = response.read().decode()
|
text: str = response.read().decode()
|
||||||
ret = callback(text)
|
ret = callback(text)
|
||||||
|
Loading…
Reference in New Issue
Block a user