diagnostics: Don't store list of app objects with results

current_results['apps'] was not being used anywhere.

Make are_results_available() check more specific, and to align with what is
stored in the database.

Tests:

- Run full diagnostics and check the results.

- Restart plinth, and check that the diagnostic results are loaded from the
  database.

Helps: #2410

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2024-04-04 10:52:36 -04:00 committed by Sunil Mohan Adapa
parent 7ffc5233c1
commit 6f0897e702
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -104,7 +104,6 @@ def _run_on_all_enabled_modules():
with results_lock:
current_results = {
'apps': [],
'results': collections.OrderedDict(),
'progress_percentage': 0,
'exception': None,
@ -125,8 +124,6 @@ def _run_on_all_enabled_modules():
apps.append((app.app_id, app))
current_results['results'][app.app_id] = {'id': app.app_id}
current_results['apps'] = apps
for current_index, (app_id, app) in enumerate(apps):
app_results = {
'diagnosis': [],
@ -330,7 +327,7 @@ def _run_diagnostics():
def are_results_available():
"""Return whether diagnostic results are available."""
with results_lock:
results = current_results
results = current_results.get('results')
if not results:
results = kvstore.get_default('diagnostics_results', '{}')