Skip to content

Commit

Permalink
heck
Browse files Browse the repository at this point in the history
  • Loading branch information
mralext20 committed Nov 17, 2023
1 parent e10a0c6 commit ff3b5d5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions alexBot/cogs/reminders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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))
Expand Down

0 comments on commit ff3b5d5

Please sign in to comment.