mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-12 17:07:23 +01:00
status_checks.py: Properly terminate the process pools (#1795)
* 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. * Acquire pools with the 'with' statement
This commit is contained in:
@@ -437,9 +437,8 @@ def system_status():
|
||||
self.items[-1]["extra"].append({ "text": message, "monospace": monospace })
|
||||
output = WebOutput()
|
||||
# Create a temporary pool of processes for the status checks
|
||||
pool = multiprocessing.pool.Pool(processes=5)
|
||||
run_checks(False, env, output, pool)
|
||||
pool.terminate()
|
||||
with multiprocessing.pool.Pool(processes=5) as pool:
|
||||
run_checks(False, env, output, pool)
|
||||
return json_response(output.items)
|
||||
|
||||
@app.route('/system/updates')
|
||||
|
||||
Reference in New Issue
Block a user