fix(sync): 优先级同步前置过滤远端失效账号防排序污染,移除 locals 隐患,并将自愈结果纳入本地日志与摘要统计

This commit is contained in:
liumangmang
2026-07-01 10:20:13 +08:00
parent efd0a88249
commit bf5470caf3
4 changed files with 403 additions and 141 deletions
+6 -1
View File
@@ -225,7 +225,12 @@ class Sub2ApiWebsiteClient:
def update_account(self, account_id: str, body: dict[str, Any], endpoint: str = "/accounts") -> dict[str, Any]:
"""更新远端账号(仅传入需要变更的字段)。"""
resp = self._request("PUT", f"{endpoint}/{account_id}", body)
try:
resp = self._request("PUT", f"{endpoint}/{account_id}", body)
except WebsiteError as exc:
if isinstance(exc.__cause__, httpx.HTTPStatusError) and exc.__cause__.response.status_code == 404:
raise WebsiteError(f"目标账号 {account_id} 不存在或已被删除") from exc.__cause__
raise
data = _unwrap_data(resp)
return data if isinstance(data, dict) else {"value": data}