Skip to content

Commit

Permalink
pass checksum_jobs (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry authored Aug 12, 2024
1 parent 419fa4b commit d099a11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/dvc_data/hashfile/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def checkout( # noqa: PLR0913
state: Optional["StateBase"] = None,
prompt: Optional[Callable[[str], bool]] = None,
old: Union["HashFile", "Tree", None] = None,
checksum_jobs: Optional[int] = None,
):
# if protocol(path) not in ["local", cache.fs.protocol]:
# raise NotImplementedError
Expand Down
6 changes: 5 additions & 1 deletion src/dvc_data/index/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ def build_entries(
compute_hash: Optional[bool] = False,
state: Optional["StateBase"] = None,
hash_name: str = DEFAULT_ALGORITHM,
checksum_jobs: Optional[int] = None,
) -> Iterable[DataIndexEntry]:
from dvc_data.hashfile.build import _get_hashes

sep = fs.sep
jobs = checksum_jobs or fs.hash_jobs
for root, dirs, files, broken in safe_walk(path, fs, ignore=ignore):
if root == path:
root_key: tuple[str, ...] = ()
Expand All @@ -94,7 +96,9 @@ def build_entries(
f"{root}{sep}{name}": info for name, info in files.items() if info
}
file_paths = list(file_infos)
hashes = _get_hashes(file_paths, fs, hash_name, file_infos, state=state)
hashes = _get_hashes(
file_paths, fs, hash_name, file_infos, state=state, jobs=jobs
)

for name, info in chain(dirs.items(), files.items()):
key = (*root_key, name)
Expand Down

0 comments on commit d099a11

Please sign in to comment.