Skip to content

Commit

Permalink
progress: add main push/pull bar
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Apr 5, 2020
1 parent 6ab06bb commit d2b0dd5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions dvc/remote/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,11 @@ def _process(
file_mode=self._file_mode,
)
status = STATUS_DELETED
desc = "Pulling"
else:
func = remote.upload
status = STATUS_NEW
desc = "Pushing"

if jobs is None:
jobs = remote.JOBS
Expand All @@ -361,11 +363,13 @@ def _process(
if len(plans[0]) == 0:
return 0

if jobs > 1:
with ThreadPoolExecutor(max_workers=jobs) as executor:
fails = sum(executor.map(func, *plans))
else:
fails = sum(map(func, *plans))
with Tqdm(total=len(plans[0]), unit="file", desc=desc) as pbar:
func = pbar.wrap_fn(func)
if jobs > 1:
with ThreadPoolExecutor(max_workers=jobs) as executor:
fails = sum(executor.map(func, *plans))
else:
fails = sum(map(func, *plans))

if fails:
if download:
Expand Down

0 comments on commit d2b0dd5

Please sign in to comment.