Merge branch 'makebuildserver-dl-timeout' into 'master'

makebuildserver: explicit timeout for cache downloading

Closes #666

See merge request fdroid/fdroidserver!648
This commit is contained in:
Michael Pöhn 2019-05-28 11:07:21 +00:00
commit da0d6393bd

View file

@ -452,8 +452,8 @@ def update_cache(cachedir):
logging.info("Downloading %s to cache", filename) logging.info("Downloading %s to cache", filename)
if download: if download:
r = requests.get(srcurl, headers=resume_header, r = requests.get(srcurl, headers=resume_header, stream=True,
stream=True, allow_redirects=True) allow_redirects=True, timeout=60)
content_length = int(r.headers.get('content-length')) content_length = int(r.headers.get('content-length'))
with open(local_filename, 'ab') as f: with open(local_filename, 'ab') as f:
for chunk in progress.bar(r.iter_content(chunk_size=65536), for chunk in progress.bar(r.iter_content(chunk_size=65536),