fix(sync): 优先级同步前置过滤远端失效账号防排序污染,移除 locals 隐患,并将自愈结果纳入本地日志与摘要统计
This commit is contained in:
@@ -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}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user