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
1 changed files with 2 additions and 2 deletions

View File

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