fix(pterodactyl): actually start the topic loop
All checks were successful
Actions / Build Documentation (MkDocs) (push) Successful in 24s
Actions / Lint Code (Ruff & Pylint) (push) Successful in 28s

This commit is contained in:
Seaswimmer 2024-03-14 16:38:23 -04:00
parent 7b859e07e9
commit c546fa597b
Signed by: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -27,12 +27,11 @@ class Pterodactyl(commands.Cog):
self.websocket: Optional[websockets.WebSocketClientProtocol] = None self.websocket: Optional[websockets.WebSocketClientProtocol] = None
self.retry_counter: int = 0 self.retry_counter: int = 0
register_config(config) register_config(config)
async def cog_load(self) -> None:
self.retry_counter = 0
self.task = self.get_task() self.task = self.get_task()
self.update_topic.start()
async def cog_unload(self) -> None: async def cog_unload(self) -> None:
self.update_topic.cancel()
self.task.cancel() self.task.cancel()
self.retry_counter = 0 self.retry_counter = 0
await self.client._session.close() # pylint: disable=protected-access await self.client._session.close() # pylint: disable=protected-access