Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jvoisin
mat2
Commits
1b37604d
Commit
1b37604d
authored
Mar 29, 2022
by
jvoisin
Browse files
Make processing multiple files safer concurrence-wise
parent
1c3e2afa
Pipeline
#83679
failed with stages
in 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mat2
View file @
1b37604d
...
...
@@ -221,14 +221,14 @@ def main() -> int:
files
=
__get_files_recursively
(
args
.
files
)
# We have to use Processes instead of Threads, since
# we're using tempfile.mkdtemp, which isn't thread-safe.
futures
=
list
()
with
concurrent
.
futures
.
ProcessPoolExecutor
()
as
executor
:
futures
=
list
()
for
f
in
files
:
future
=
executor
.
submit
(
clean_meta
,
f
,
args
.
lightweight
,
inplace
,
args
.
sandbox
,
policy
)
futures
.
append
(
future
)
for
future
in
concurrent
.
futures
.
as_completed
(
futures
):
no_failure
&=
future
.
result
()
for
future
in
concurrent
.
futures
.
as_completed
(
futures
):
no_failure
&=
future
.
result
()
return
0
if
no_failure
is
True
else
-
1
...
...
jvoisin
@jvoisin
mentioned in issue
#168 (closed)
·
Mar 29, 2022
mentioned in issue
#168 (closed)
mentioned in issue #168
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment