mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-13 07:18:25 +01:00
utils: collect return value from map
Zip it together with the targets list and return back to the caller so he can use it if he wants. Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+3
-1
@@ -68,8 +68,10 @@ def map_progress(func, targets, n_threads):
|
||||
p = ThreadPool(processes=n_threads)
|
||||
|
||||
try:
|
||||
p.map(func, targets)
|
||||
ret = p.map(func, targets)
|
||||
except Exception as exc:
|
||||
Logger.error('Unexpected exception while processing targets: {}'.format(exc))
|
||||
finally:
|
||||
progress.finish()
|
||||
|
||||
return zip(targets, ret)
|
||||
|
||||
Reference in New Issue
Block a user