Skip to content

Commit

Permalink
fix missing path creation that was causing tests to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
bhlieberman committed May 13, 2024
1 parent 331c151 commit 3ea5afc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion biobricks/dvc_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class DownloadManager:
interrupt_event : threading.Event = threading.Event()

def exec_task(self, url, path):
path.parent.mkdir(parents=True, exist_ok=True)
response = requests.get(url, stream=True, headers=self.headers)
response.raise_for_status()
total_size = int(response.headers.get('content-length', 0))
Expand All @@ -35,7 +36,7 @@ def exec_task(self, url, path):
if data:
file.write(data)
progress.update(len(data))
self.total_progress_bar.update(len(data))
# total_progress_bar.update(len(data))

def download_exec(self, urls, paths, max_threads=4):
signal.signal(signal.SIGINT, lambda signum, frame: signal_handler(signum, frame, self.interrupt_event))
Expand All @@ -46,6 +47,7 @@ def download_exec(self, urls, paths, max_threads=4):
try:
data = future.result()
except Exception as e:
logger.error(e)
logger.warning("Exception occurred while downloading brick.")


Expand Down

0 comments on commit 3ea5afc

Please sign in to comment.