From a53e993f4d0a5566b66a8d7e5ffc801c428f8c80 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Mon, 15 Aug 2022 19:42:23 -0600 Subject: [PATCH] Chunk all guilds on startup --- jarvis/client.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jarvis/client.py b/jarvis/client.py index 6c14b29..c08366f 100644 --- a/jarvis/client.py +++ b/jarvis/client.py @@ -82,6 +82,12 @@ class Jarvis(StatsClient): self.phishing_domains = [] self.pre_run_callback = self._prerun + async def _chunk_all(self) -> None: + """Chunk all guilds.""" + for guild in self.guilds: + self.logger.debug(f"Chunking guild {guild.name} <{guild.id}>") + await guild.chunk_guild() + @Task.create(IntervalTrigger(hours=1)) async def _update_domains(self) -> None: self.logger.debug("Updating phishing domains") @@ -137,6 +143,7 @@ class Jarvis(StatsClient): try: await self._sync_domains() self._update_domains.start() + asyncio.create_task(self._chunk_all()) except Exception as e: self.logger.error("Failed to load anti-phishing", exc_info=e) self.logger.info("Logged in as {}".format(self.user)) # noqa: T001