Make processing multiple files safer concurrence-wise
This commit is contained in:
parent
1c3e2afa1e
commit
1b37604d3a
2
mat2
2
mat2
@ -221,8 +221,8 @@ def main() -> int:
|
|||||||
files = __get_files_recursively(args.files)
|
files = __get_files_recursively(args.files)
|
||||||
# We have to use Processes instead of Threads, since
|
# We have to use Processes instead of Threads, since
|
||||||
# we're using tempfile.mkdtemp, which isn't thread-safe.
|
# we're using tempfile.mkdtemp, which isn't thread-safe.
|
||||||
with concurrent.futures.ProcessPoolExecutor() as executor:
|
|
||||||
futures = list()
|
futures = list()
|
||||||
|
with concurrent.futures.ProcessPoolExecutor() as executor:
|
||||||
for f in files:
|
for f in files:
|
||||||
future = executor.submit(clean_meta, f, args.lightweight,
|
future = executor.submit(clean_meta, f, args.lightweight,
|
||||||
inplace, args.sandbox, policy)
|
inplace, args.sandbox, policy)
|
||||||
|
Loading…
Reference in New Issue
Block a user