refactor: simplify CLI Apps route await
This commit is contained in:
@@ -8,7 +8,6 @@ request mapping and response shaping.
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import inspect
|
||||
import json
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
@@ -310,12 +309,7 @@ class WebUISettingsRouter:
|
||||
"yes",
|
||||
}
|
||||
try:
|
||||
payload_result = (
|
||||
cli_apps_payload(installed_only=True)
|
||||
if installed_only
|
||||
else cli_apps_payload()
|
||||
)
|
||||
payload = await payload_result if inspect.isawaitable(payload_result) else payload_result
|
||||
payload = await cli_apps_payload(installed_only=installed_only)
|
||||
except Exception:
|
||||
self.logger.exception("failed to load CLI Apps payload")
|
||||
return self._error_response(500, "failed to load CLI Apps")
|
||||
|
||||
Reference in New Issue
Block a user