Skip to content

Commit

Permalink
[waicolle] ignore redis errors for next drop counter
Browse files Browse the repository at this point in the history
we lose the progress on the previous counter but at least it works™
  • Loading branch information
odrling committed Jan 16, 2025
1 parent c700306 commit 8016f1e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nanachan/extensions/waicolle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 8016f1e

Please sign in to comment.