From 8016f1efed137912921b3b9de581b2bffeac47d7 Mon Sep 17 00:00:00 2001 From: odrling Date: Thu, 16 Jan 2025 19:28:41 +0100 Subject: [PATCH] [waicolle] ignore redis errors for next drop counter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we lose the progress on the previous counter but at least it works™ --- nanachan/extensions/waicolle.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nanachan/extensions/waicolle.py b/nanachan/extensions/waicolle.py index 4da281fc..ab7cdd6d 100644 --- a/nanachan/extensions/waicolle.py +++ b/nanachan/extensions/waicolle.py @@ -2552,8 +2552,12 @@ def log_user_messages(self, user: discord.User | discord.Member): logger.info(f'{user} ignored messages: {self.ignored_messages[user.id]}/{total}') async def drp_factory(self, guild_id: int) -> int | float: - if (redis_val := await next_drop.get(str(guild_id))) is not None: - return redis_val + # ignore redis connection errors, does mean we lose our progress + try: + if (redis_val := await next_drop.get(str(guild_id))) is not None: + return redis_val + except Exception: + pass return self._drp_factory()