Skip to content
Snippets Groups Projects
Commit eae66f4d authored by yvesn's avatar yvesn
Browse files

SSDM-6731: pybis - marking task as done when failing to download file so the...

SSDM-6731: pybis - marking task as done when failing to download file so the process does not get stuck
parent 358e364a
No related branches found
No related tags found
No related merge requests found
......@@ -514,6 +514,7 @@ class DataSetDownloadQueue():
# request the file in streaming mode
r = requests.get(url, stream=True, verify=verify_certificates)
if r.ok == False:
self.download_queue.task_done()
raise ValueError("Could not download from {}: HTTP {}. Reason: {}".format(url, r.status_code, r.reason))
with open(filename_dest, write_mode) as f:
......@@ -525,5 +526,6 @@ class DataSetDownloadQueue():
if self.collect_files_with_wrong_length:
self.files_with_wrong_length.append(filename)
else:
self.download_queue.task_done()
raise ValueError("File has the wrong length: {}".format(filename_dest))
self.download_queue.task_done()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment