Skip to content

Commit 91b2055

Browse files
authored
Add startup and daemon tasks canceling on cog unload
1 parent 00687fa commit 91b2055

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bot/exts/backend/branding/_cog.py

+6
Original file line numberDiff line numberDiff line change
@@ -559,3 +559,9 @@ async def set_icon(self, url: str) -> bool:
559559
return False
560560

561561
return await self._apply_asset(guild, _constants.AssetType.SERVER_ICON, url)
562+
563+
def cog_unload(self) -> None:
564+
"""Cancels startup and daemon task."""
565+
self._startup_task.cancel()
566+
if self.daemon is not None:
567+
self.daemon.cancel()

0 commit comments

Comments
 (0)