Skip to content

Commit

Permalink
Fix deprecated behaviour for asyncio.wait() (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
Infernum1 authored Jan 17, 2025
1 parent 75a80dd commit 966ca12
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions karen/karen.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,13 @@ async def loop_remind_reminders(self):
"RETURNING channel_id, user_id, message_id, reminder",
)

broadcast_coros = [self.server.broadcast(PacketType.REMINDER, {**r}) for r in reminders]
broadcast_tasks = [
asyncio.create_task(self.server.broadcast(PacketType.REMINDER, {**r}))
for r in reminders
]

for coros_chunk in chunk_sequence(broadcast_coros, 4):
await asyncio.wait(coros_chunk)
for tasks_chunk in chunk_sequence(broadcast_tasks, 4):
await asyncio.wait(tasks_chunk)

@recurring_task(minutes=30, sleep_first=False)
async def loop_clear_weekly_leaderboards(self):
Expand Down

0 comments on commit 966ca12

Please sign in to comment.