зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1821513 - set a timeout for fetch-content downloads. r=releng-reviewers,gbrown
Setting a timeout on the download means we can retry if the connection hangs, instead of sitting around idle until the task itself hits its maxRunTime. Differential Revision: https://phabricator.services.mozilla.com/D173287
This commit is contained in:
Родитель
c6a93ac62f
Коммит
2ad2b6612b
|
@ -183,8 +183,8 @@ def stream_download(url, sha256=None, size=None):
|
|||
|
||||
t0 = time.time()
|
||||
with urllib.request.urlopen(
|
||||
url, cafile=certifi.where()
|
||||
) if certifi else urllib.request.urlopen(url) as fh:
|
||||
url, timeout=60, cafile=certifi.where()
|
||||
) if certifi else urllib.request.urlopen(url, timeout=60) as fh:
|
||||
if not url.endswith(".gz") and fh.info().get("Content-Encoding") == "gzip":
|
||||
fh = gzip.GzipFile(fileobj=fh)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче