Skip to content

Commit

Permalink
[projection] fix reminder loop restarting on reconnection
Browse files Browse the repository at this point in the history
  • Loading branch information
odrling committed Jan 20, 2025
1 parent 36ac090 commit 785af78
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions nanachan/extensions/projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from enum import Enum
from functools import partial
from operator import getitem
from typing import Iterable, MutableSequence, cast
from typing import Iterable, MutableSequence, cast, override
from uuid import UUID

import discord
Expand Down Expand Up @@ -85,7 +85,12 @@ async def on_ready(self):

asyncio.create_task(self.sync_participants(projos))

self.remind_projo.start()
if not self.remind_projo.is_running():
self.remind_projo.start()

@override
async def cog_unload(self):
self.remind_projo.cancel()

@tasks.loop(time=time(hour=9, minute=0, tzinfo=TZ))
async def remind_projo(self):
Expand Down

0 comments on commit 785af78

Please sign in to comment.