We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a9e9fd commit c8d8c7cCopy full SHA for c8d8c7c
examples/benchmarking-scripts/backfill.py
@@ -48,16 +48,8 @@ def run_pyperformance(revision):
48
49
if __name__ == "__main__":
50
original_sigint_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
51
- pool = Pool(8)
52
signal.signal(signal.SIGINT, original_sigint_handler)
53
- try:
+ with Pool(8) as pool:
54
res = pool.map_async(run_pyperformance, get_revisions())
55
# Without the timeout this blocking call ignores all signals.
56
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