mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
refactor: unify agent data port access
This commit is contained in:
@@ -7,7 +7,7 @@ from pydantic import BaseModel, Field
|
||||
from app.agent.tools.base import MoviePilotTool
|
||||
from app.agent.tools.tags import ToolTag
|
||||
from app.chain.site import SiteChain
|
||||
from app.application.agentdata import SitePort as SiteOper
|
||||
from app.application.agentdata import get_agent_site_port
|
||||
from app.runtime.log import logger
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class TestSiteTool(MoviePilotTool):
|
||||
@staticmethod
|
||||
def _test_site_sync(site_identifier: int) -> tuple[Optional[str], Optional[str], bool, str]:
|
||||
"""在同步线程里执行站点联通测试,避免网络请求卡住事件循环。"""
|
||||
site = SiteOper().get(site_identifier)
|
||||
site = get_agent_site_port().get(site_identifier)
|
||||
if not site:
|
||||
return None, None, False, f"未找到站点:{site_identifier},请使用 query_sites 工具查询可用的站点"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user