Skip to content

Commit

Permalink
index: fetch: don't forget onerror
Browse files Browse the repository at this point in the history
  • Loading branch information
efiop committed Jan 23, 2024
1 parent 300a3e0 commit c5a89dd
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/dvc_data/index/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,23 @@ def fetch(
failed += len(result.failed)
elif isinstance(cache, ObjectStorage):
md5(fs_index, check_meta=False)
fetched += save(fs_index, jobs=jobs, callback=cb)

def _on_error(failed, oid, exc):
if isinstance(exc, FileNotFoundError):
return
failed += 1
logger.debug(
"failed to transfer '%s'",
oid,
exc_info=True,
)

fetched += save(
fs_index,
jobs=jobs,
callback=cb,
on_error=partial(_on_error, failed),
)
else:
old = build(cache.path, cache.fs)
diff = compare(old, fs_index)
Expand Down

0 comments on commit c5a89dd

Please sign in to comment.