Skip to content

Commit

Permalink
fix: fixed an issue with LastUpdatedAt cache refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
TeKrop committed Aug 27, 2024
1 parent 9325b4f commit e9afe25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/commands/check_and_update_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
from app.parsers.player_parser import PlayerParser
from app.parsers.player_stats_summary_parser import PlayerStatsSummaryParser
from app.parsers.roles_parser import RolesParser
from app.parsers.search_data_parser import NamecardParser
from app.parsers.search_data_parser import LastUpdatedAtParser, NamecardParser

# Mapping of parser class names to linked classes
PARSER_CLASSES_MAPPING = {
"GamemodesParser": GamemodesParser,
"HeroParser": HeroParser,
"HeroesParser": HeroesParser,
"HeroesStatsParser": HeroesStatsParser,
"LastUpdatedAtParser": LastUpdatedAtParser,
"MapsParser": MapsParser,
"NamecardParser": NamecardParser,
"PlayerParser": PlayerParser,
Expand Down Expand Up @@ -70,7 +71,7 @@ def get_request_parser_class(cache_key: str) -> tuple[type, dict]:
cache_kwargs["locale"] = uri[1]
if "Player" in parser_class_name:
cache_kwargs["player_id"] = uri[3]
elif parser_class_name == "NamecardParser":
elif parser_class_name in ("LastUpdatedAtParser", "NamecardParser"):
cache_kwargs["player_id"] = uri[4].replace("#", "-")
elif parser_class_name == "HeroParser":
cache_kwargs["hero_key"] = uri[3]
Expand Down

0 comments on commit e9afe25

Please sign in to comment.