review(onmyoji_gacha): fix 2x timeout + Pydantic v2 model_validator + review report

This commit is contained in:
2026-05-10 00:37:18 +08:00
parent c62ac37611
commit 260c66636e
3 changed files with 61 additions and 4 deletions

View File

@@ -51,7 +51,7 @@ async def query_qq_binding(qq: str) -> Tuple[bool, Optional[str], Optional[str]]
url = f"{DD_API_HOST}query_qq_binding"
data = {"qq": qq}
response = await asyncio.to_thread(requests.post, url=url, json=data)
response = await asyncio.to_thread(requests.post, url=url, json=data, timeout=10)
logger.debug(f"查询QQ绑定状态响应: {response}")
if response.status_code != 200:
@@ -106,7 +106,7 @@ async def add_user_viptime(username: str, time_class: str = "Day", count: int =
"classes": time_class
}
response = await asyncio.to_thread(requests.post, url=url, json=data)
response = await asyncio.to_thread(requests.post, url=url, json=data, timeout=10)
logger.debug(f"添加VIP时间响应({i+1}/{count}): {response}")
if response.status_code != 200: