feat(weibo): 增加外部单协作台账
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user