🐛 Fix daily note tasks update status

This commit is contained in:
xtaodada 2024-02-18 14:41:29 +08:00
parent 3ada9ee84d
commit 094ff86283
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -219,6 +219,7 @@ class DailyNoteSystem(Plugin):
else:
user.resin.notice_num = web_config.resin.notice_num
user.resin.noticed = False
user.resin_db.status = TaskStatusEnum.STATUS_SUCCESS
else:
if user.resin_db:
await self.resin_service.remove(user.resin_db)
@ -236,6 +237,7 @@ class DailyNoteSystem(Plugin):
await self.expedition_service.add(expedition)
else:
user.expedition.noticed = False
user.expedition_db.status = TaskStatusEnum.STATUS_SUCCESS
else:
if user.expedition_db:
await self.expedition_service.remove(user.expedition_db)
@ -302,8 +304,6 @@ class DailyNoteSystem(Plugin):
except Exception as exc:
logger.error("执行自动便签提醒时发生错误 user_id[%s]", user_id, exc_info=exc)
continue
else:
task_user_db.status = TaskStatusEnum.STATUS_SUCCESS
await self.update_task_user(task_db)
async def get_migrate_data(self, old_user_id: int, new_user_id: int, _) -> Optional["TaskMigrate"]: