feat(weibo): 增加外部单协作台账

This commit is contained in:
yml2213
2026-11-08 11:41:54 +08:00
parent a0afa430ec
commit 79cfd4a634
16 changed files with 5217 additions and 4 deletions
+6 -3
View File
@@ -115,6 +115,7 @@ def refresh_weibo_account(
account: WeiboAccount,
*,
activity: str = "",
commit: bool = True,
) -> WeiboHomeSnapshot:
"""刷新一个微博账号;失败时保留旧资料并记录本次检查状态。"""
@@ -126,12 +127,14 @@ def refresh_weibo_account(
account.ck_check_status = _error_status(exc)
account.ck_check_message = str(exc)
account.ck_checked_at = _now()
db.commit()
if commit:
db.commit()
raise
_apply_snapshot(account, snapshot, account.cookie or "")
db.commit()
db.refresh(account)
if commit:
db.commit()
db.refresh(account)
return snapshot