Skip to content

Commit

Permalink
transfer: only verify on pull
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrowla committed Jul 20, 2021
1 parent 8d07ca7 commit a36750a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions dvc/data_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def pull(
jobs=jobs,
src_index=get_index(odb),
cache_odb=self.repo.odb.local,
verify=odb.verify,
)

def status(
Expand Down
17 changes: 13 additions & 4 deletions dvc/objects/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def wrapper(odb, obj, *args, **kwargs):
return wrapper


def _transfer(src, dest, dir_objs, file_objs, missing, jobs, **kwargs):
def _transfer(src, dest, dir_objs, file_objs, missing, jobs, verify, **kwargs):
from . import save
from .stage import is_memfs_staging

Expand All @@ -54,7 +54,14 @@ def _transfer(src, dest, dir_objs, file_objs, missing, jobs, **kwargs):
func = pbar.wrap_fn(func)
with ThreadPoolExecutor(max_workers=jobs) as executor:
processor = partial(
_create_tasks, executor, jobs, func, src, dest, is_staged
_create_tasks,
executor,
jobs,
func,
src,
dest,
is_staged,
verify,
)
processor.save_func = func
_do_transfer(
Expand All @@ -69,7 +76,7 @@ def _transfer(src, dest, dir_objs, file_objs, missing, jobs, **kwargs):
return total


def _create_tasks(executor, jobs, func, src, dest, is_staged, objs):
def _create_tasks(executor, jobs, func, src, dest, is_staged, verify, objs):
fails = 0
obj_iter = iter(objs)

Expand All @@ -80,7 +87,7 @@ def create_taskset(amount):
dest,
_raw_obj(src, obj, is_staged),
move=False,
verify=src.verify,
verify=verify,
)
for obj in itertools.islice(obj_iter, amount)
}
Expand Down Expand Up @@ -180,6 +187,7 @@ def transfer(
dest: "ObjectDB",
objs: Iterable["HashFile"],
jobs: Optional[int] = None,
verify: bool = False,
**kwargs,
) -> int:
"""Transfer (copy) the specified objects from one ODB to another.
Expand Down Expand Up @@ -214,5 +222,6 @@ def transfer(
files,
status.missing,
jobs,
verify,
**kwargs,
)

0 comments on commit a36750a

Please sign in to comment.