зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1364695
- Make `mach artifact toolchain` also retry on ConnectionError. r=gps
This commit is contained in:
Родитель
979b71f23b
Коммит
e5060e87be
|
@ -1784,12 +1784,18 @@ class PackageFrontend(MachCommandBase):
|
|||
sleeptime=60)):
|
||||
try:
|
||||
record.fetch_with(cache)
|
||||
except requests.exceptions.HTTPError as e:
|
||||
status = e.response.status_code
|
||||
# The relengapi proxy likes to return error 400 bad request
|
||||
# which seems improbably to be due to our (simple) GET
|
||||
# being borked.
|
||||
should_retry = status >= 500 or status == 400
|
||||
except (requests.exceptions.HTTPError,
|
||||
requests.exceptions.ConnectionError) as e:
|
||||
|
||||
if isinstance(e, requests.exceptions.ConnectionError)
|
||||
should_retry = True
|
||||
else:
|
||||
# The relengapi proxy likes to return error 400 bad request
|
||||
# which seems improbably to be due to our (simple) GET
|
||||
# being borked.
|
||||
status = e.response.status_code
|
||||
should_retry = status >= 500 or status == 400
|
||||
|
||||
if should_retry or attempt < retry:
|
||||
level = logging.WARN
|
||||
else:
|
||||
|
|
Загрузка…
Ссылка в новой задаче