Skip to content

Commit c8d8c7c

Browse files
diegorussocorona10
andauthored
Update examples/benchmarking-scripts/backfill.py
Co-authored-by: Donghee Na <[email protected]>
1 parent 2a9e9fd commit c8d8c7c

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

examples/benchmarking-scripts/backfill.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,8 @@ def run_pyperformance(revision):
4848

4949
if __name__ == "__main__":
5050
original_sigint_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
51-
pool = Pool(8)
5251
signal.signal(signal.SIGINT, original_sigint_handler)
53-
try:
52+
with Pool(8) as pool:
5453
res = pool.map_async(run_pyperformance, get_revisions())
5554
# Without the timeout this blocking call ignores all signals.
5655
res.get(86400)
57-
except KeyboardInterrupt:
58-
print("Caught KeyboardInterrupt, terminating workers")
59-
pool.terminate()
60-
else:
61-
print("Normal termination")
62-
pool.close()
63-
pool.join()

0 commit comments

Comments
 (0)