🐛 修复全部重签成功后数据库的签到状态未修改的问题

This commit is contained in:
洛水居室 2022-10-16 00:19:22 +08:00
parent 9f2fc56ea5
commit 37d453e439
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -63,6 +63,8 @@ class SignAll(Plugin):
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]") logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
logger.exception(exc) logger.exception(exc)
text = "签到失败了呜呜呜 ~ 执行自动签到时发生错误" text = "签到失败了呜呜呜 ~ 执行自动签到时发生错误"
else:
sign_db.status = SignStatusEnum.STATUS_SUCCESS
if sign_db.chat_id < 0: if sign_db.chat_id < 0:
text = f'<a href="tg://user?id={sign_db.user_id}">NOTICE {sign_db.user_id}</a>\n\n{text}' text = f'<a href="tg://user?id={sign_db.user_id}">NOTICE {sign_db.user_id}</a>\n\n{text}'
try: try:
@ -81,6 +83,8 @@ class SignAll(Plugin):
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]") logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
logger.exception(exc) logger.exception(exc)
continue continue
else:
sign_db.status = SignStatusEnum.STATUS_SUCCESS
sign_db.time_updated = datetime.datetime.now() sign_db.time_updated = datetime.datetime.now()
if sign_db.status != old_status: if sign_db.status != old_status:
await self.sign_service.update(sign_db) await self.sign_service.update(sign_db)