clan-app: Add threaded api execution by default

This commit is contained in:
Qubasa
2024-07-16 20:44:48 +02:00
parent 85e16e0f6c
commit d7c3d8185a
2 changed files with 48 additions and 16 deletions

View File

@@ -89,12 +89,19 @@ class WebExecutor(GObject.Object):
# Extract the data from the payload
data = payload.get("data")
if data is None:
log.error(f"Method '{method_name}' has no data field. Skipping execution.")
log.error(
f"JS function call '{method_name}' has no data field. Skipping execution."
)
return
if data.get("op_key") is None:
log.error(
f"JS function call '{method_name}' has no op_key field. Skipping execution."
)
return
# Initialize dataclasses from the payload
reconciled_arguments = {}
for k, v in data.items():
# Some functions expect to be called with dataclass instances
# But the js api returns dictionaries.