mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-04-20 02:52:11 +00:00
Only spawn a thread pool when strictly needed
For --check-primary-hostname, the pool is not used. When exiting, the other processes are left alive and will hang.
This commit is contained in:
parent
967409b157
commit
b4fd79673b
@ -1021,12 +1021,13 @@ if __name__ == "__main__":
|
|||||||
from utils import load_environment
|
from utils import load_environment
|
||||||
|
|
||||||
env = load_environment()
|
env = load_environment()
|
||||||
pool = multiprocessing.pool.Pool(processes=10)
|
|
||||||
|
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
|
pool = multiprocessing.pool.Pool(processes=10)
|
||||||
run_checks(False, env, ConsoleOutput(), pool)
|
run_checks(False, env, ConsoleOutput(), pool)
|
||||||
|
|
||||||
elif sys.argv[1] == "--show-changes":
|
elif sys.argv[1] == "--show-changes":
|
||||||
|
pool = multiprocessing.pool.Pool(processes=10)
|
||||||
run_and_output_changes(env, pool)
|
run_and_output_changes(env, pool)
|
||||||
|
|
||||||
elif sys.argv[1] == "--check-primary-hostname":
|
elif sys.argv[1] == "--check-primary-hostname":
|
||||||
|
Loading…
Reference in New Issue
Block a user