app: Don't load apps again

- Only effective once. Second call will skip loading apps.

- Helps with privileged daemon where actions might load apps repeatedly.

Tests:

- Diagnostics/enable/disable for apps bepasty, updates, config, security,
  nextcloud, homeassistant run fine.

- Install/uninstall for bepasty works fine.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
This commit is contained in:
Sunil Mohan Adapa authored and Joseph Nuthalapati committed 2025-08-16 22:39:18 +05:30
1 parent e100c89ecc
commit f2edc6ab2b
1 file changed
+3
+3
View File
@@ -596,6 +596,9 @@ class EnableState(LeaderComponent):
def apps_init():
"""Create apps by constructing them with components."""
if App.list():
return # Apps have already been initialized
from . import module_loader # noqa # Avoid circular import
for module_name, module in module_loader.loaded_modules.items():
_initialize_module(module_name, module)