fix(oci): keep update results when one application fails

- Check that the Monitor answers on its socket, not only that it exists
- Report the applications whose check failed instead of failing the whole request
- Show those applications as not checked, without their older result
- Tell the user in the menu when a check fails
This commit is contained in:
MacRimi
2026-10-19 17:23:58 +02:00
parent e138f4c800
commit 818ab1308a
12 changed files with 113 additions and 20 deletions
+4 -4
View File
@@ -74,19 +74,19 @@ def check_applications(module, rows, report):
module.check_app(vmid, app['id'], force=True, notify=False)
pool = ThreadPoolExecutor(max_workers=_CHECK_WORKERS, thread_name_prefix='oci-check')
failed = False
failed = []
try:
futures = [pool.submit(check_one, row) for row in rows]
futures = {pool.submit(check_one, row): row['vmid'] for row in rows}
for completed, future in enumerate(as_completed(futures), 1):
try:
future.result()
except Exception:
failed = True # One failure never stops the other applications.
failed.append(futures[future]) # One failure never stops the other applications.
report({'completed': completed, 'total': len(rows)})
finally:
stopped.set()
pool.shutdown(wait=True, cancel_futures=True)
report({'error': 'check_failed'} if failed else {'done': True})
report({'done': True, 'failed': sorted(failed)})
class _Handler(socketserver.StreamRequestHandler):