From ff3b5d5dc7ba420a714eba14f1f958e1aaee742c Mon Sep 17 00:00:00 2001 From: Alexander Terry Date: Thu, 16 Nov 2023 15:52:15 -0900 Subject: [PATCH] heck --- alexBot/cogs/reminders.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/alexBot/cogs/reminders.py b/alexBot/cogs/reminders.py index 76c8ba9..6cef80e 100644 --- a/alexBot/cogs/reminders.py +++ b/alexBot/cogs/reminders.py @@ -58,7 +58,6 @@ async def reminder_loop(self): reminders = await session.scalars(stmt) for reminder in reminders: if reminder.id not in self.tasks: - if self.tasks[reminder.id] = self.bot.loop.create_task(self.remind(reminder)) await asyncio.sleep(60) @@ -69,10 +68,10 @@ async def remind(self, reminder: Reminder): if now > reminder.next_remind: log.warning(f"reminder {reminder} is overdue") if reminder.frequency: - #ok, we should skip the missed recurres, and just do the next one + # ok, we should skip the missed recurres, and just do the next one while now > reminder.next_remind: reminder.next_remind = reminder.next_remind + reminder.frequency - + async with db.async_session() as session: async with session.begin(): edited = await session.scalar(select(Reminder).where(Reminder.id == reminder.id))