fix: address review feedback (#120)

- Remove cache write in user-team fallback path of _get_channel_embed_color()
  to prevent cross-user color contamination in non-team channels (e.g. #general)
- Invalidate _standings_cache on recalculate_standings() so admin-triggered
  recalculations are reflected immediately rather than after 10min TTL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-04-10 16:02:02 -05:00
parent 7a4a2e6d25
commit e56677acc5
2 changed files with 1 additions and 2 deletions

View File

@ -417,8 +417,6 @@ class DiceRollCommands(commands.Cog):
team = await get_user_major_league_team(user_id=interaction.user.id)
if team is not None and team.color is not None:
color = int(team.color, 16)
if channel_id is not None:
_channel_color_cache[channel_id] = (color, time.time())
return color
return EmbedColors.PRIMARY

View File

@ -249,6 +249,7 @@ class StandingsService:
)
logger.info(f"Recalculated standings for season {season}")
_standings_cache.pop(season, None)
return True
except Exception as e: