fix: 失败账号按间隔重试,请求并发不再占满整段学习

This commit is contained in:
2026-11-16 09:04:29 +08:00
parent 174d7a49e3
commit 91b06cde25
7 changed files with 137 additions and 46 deletions
+9 -2
View File
@@ -1354,8 +1354,15 @@ class EunivClient:
response = self._request("POST", f"{YXT_API}/v1/customdiy/user/getuserinfobyid", content=b"")
except SessionExpired:
return False
payload = response.json()
return isinstance(payload, dict) and bool(payload.get("cnName"))
if response.status_code >= 500 or response.status_code == 429:
raise RuntimeError("学习平台暂时不可用")
try:
payload = response.json()
except ValueError as exc:
raise RuntimeError("学习平台暂时不可用") from exc
if not isinstance(payload, dict):
raise RuntimeError("学习平台暂时不可用")
return bool(payload.get("cnName"))
def _pages(self, url: str, headers: dict, html: str, parse, identity: str) -> list[dict]:
items = parse(html)