mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 04:35:49 +00:00
🐛 Fix daily note task timeout
This commit is contained in:
parent
3977680cc2
commit
9408102a82
@ -13,7 +13,7 @@ class CardJob(Plugin):
|
||||
def __init__(self, card_system: BirthdayCardSystem):
|
||||
self.card_system = card_system
|
||||
|
||||
@job.run_daily(time=datetime.time(hour=0, minute=1, second=0), name="CardJob")
|
||||
@job.run_daily(time=datetime.time(hour=0, minute=23, second=0), name="CardJob")
|
||||
async def card(self, context: "ContextTypes.DEFAULT_TYPE"):
|
||||
logger.info("正在执行自动领取生日画片")
|
||||
await self.card_system.do_get_card_job(context)
|
||||
|
@ -307,6 +307,7 @@ class DailyNoteSystem(Plugin):
|
||||
if task_db.status not in include_status:
|
||||
continue
|
||||
user_id = task_db.user_id
|
||||
logger.info("自动便签提醒 - 请求便签信息 user_id[%s]", user_id)
|
||||
try:
|
||||
async with self.genshin_helper.genshin(user_id) as client:
|
||||
text = await self.start_get_notes(client, task_db)
|
||||
@ -319,8 +320,8 @@ class DailyNoteSystem(Plugin):
|
||||
text = f"自动便签提醒执行失败,API返回信息为 {str(exc)}"
|
||||
task_db.status = TaskStatusEnum.GENSHIN_EXCEPTION
|
||||
except SimnetTimedOut:
|
||||
text = "便签获取失败了呜呜呜 ~ 服务器连接超时 服务器熟啦 ~ "
|
||||
task_db.status = TaskStatusEnum.TIMEOUT_ERROR
|
||||
logger.info("用户 user_id[%s] 请求便签超时", user_id)
|
||||
continue
|
||||
except PlayerNotFoundError:
|
||||
logger.info("用户 user_id[%s] 玩家不存在 关闭并移除自动便签提醒", user_id)
|
||||
await self.remove_task_user(task_db)
|
||||
|
Loading…
Reference in New Issue
Block a user