mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-29 20:57:22 +02:00
Acquire pools with the 'with' statement
This commit is contained in:
@@ -1036,14 +1036,12 @@ if __name__ == "__main__":
|
||||
env = load_environment()
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
pool = multiprocessing.pool.Pool(processes=10)
|
||||
run_checks(False, env, ConsoleOutput(), pool)
|
||||
pool.terminate()
|
||||
with multiprocessing.pool.Pool(processes=10) as pool:
|
||||
run_checks(False, env, ConsoleOutput(), pool)
|
||||
|
||||
elif sys.argv[1] == "--show-changes":
|
||||
pool = multiprocessing.pool.Pool(processes=10)
|
||||
run_and_output_changes(env, pool)
|
||||
pool.terminate()
|
||||
with multiprocessing.pool.Pool(processes=10) as pool:
|
||||
run_and_output_changes(env, pool)
|
||||
|
||||
elif sys.argv[1] == "--check-primary-hostname":
|
||||
# See if the primary hostname appears resolvable and has a signed certificate.
|
||||
|
||||
Reference in New Issue
Block a user