Skip to content

Commit

Permalink
use callback.wrap to iterate on the main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry authored Jan 31, 2025
1 parent 041d4ff commit e8a680d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dvc/fs/dvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,6 @@ def get_file(arg: tuple[FileSystem, tuple[str, str, Optional[dict]]]):
kw = kw | {"info": info}
with callback.branched(src, dest) as child:
fs.get_file(src, dest, callback=child, **kw)
callback.relative_update()

if batch_size == 1:
ctx: AbstractContextManager = nullcontext()
Expand All @@ -591,7 +590,7 @@ def get_file(arg: tuple[FileSystem, tuple[str, str, Optional[dict]]]):

with ctx:
it = ((fs, f) for fs, files in _files.items() for f in files)
deque(map_fn(get_file, it), maxlen=0)
deque(callback.wrap(map_fn(get_file, it)), maxlen=0)
return result

def get_file(self, rpath, lpath, **kwargs):
Expand Down

0 comments on commit e8a680d

Please sign in to comment.