sync update from LAN repo (source dhk-1 @ 3e87be55)

This commit is contained in:
gozeros committed 2026-10-21 15:06:08 +08:00
1 parent ab6068a7c1
commit 42f2a26fa8
1482 files changed
+227759 -9584

No files matched your search

@@ -2,6 +2,8 @@
from __future__ import annotations
from functools import lru_cache
import httpx
from deerflow.config import get_app_config
@@ -37,9 +39,30 @@ def build_weknora_client(
) -> WeKnoraClient:
if not runtime.weknora_enabled:
raise RuntimeError("WeKnora mode is not enabled")
if http_client is None:
return _shared_weknora_client(
runtime.api_base_url,
runtime.admin_email,
runtime.admin_password,
)
return WeKnoraClient(
base_url=runtime.api_base_url,
http_client=http_client,
admin_email=runtime.admin_email,
admin_password=runtime.admin_password,
)
@lru_cache(maxsize=4)
def _shared_weknora_client(
base_url: str,
admin_email: str,
admin_password: str,
) -> WeKnoraClient:
"""Reuse auth state for equivalent runtime configurations."""
return WeKnoraClient(
base_url=base_url,
admin_email=admin_email,
admin_password=admin_password,
)