mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 05:42:59 +00:00
adjust milb use of cache
This commit is contained in:
@@ -436,7 +436,11 @@ class CacheManager:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
config = self.config_manager.get_config()
|
config = self.config_manager.get_config()
|
||||||
sport_config = config.get(f"{sport_key}_scoreboard", {})
|
# For MiLB, look for "milb" config instead of "milb_scoreboard"
|
||||||
|
if sport_key == 'milb':
|
||||||
|
sport_config = config.get("milb", {})
|
||||||
|
else:
|
||||||
|
sport_config = config.get(f"{sport_key}_scoreboard", {})
|
||||||
return sport_config.get("live_update_interval", 60) # Default to 60 seconds
|
return sport_config.get("live_update_interval", 60) # Default to 60 seconds
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.warning(f"Could not get live_update_interval for {sport_key}: {e}")
|
self.logger.warning(f"Could not get live_update_interval for {sport_key}: {e}")
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ class BaseMiLBManager:
|
|||||||
|
|
||||||
def _fetch_milb_api_data(self, use_cache: bool = True) -> Dict[str, Any]:
|
def _fetch_milb_api_data(self, use_cache: bool = True) -> Dict[str, Any]:
|
||||||
"""Fetch MiLB game data from the MLB Stats API."""
|
"""Fetch MiLB game data from the MLB Stats API."""
|
||||||
cache_key = "milb_api_data"
|
cache_key = "milb_live_api_data"
|
||||||
if use_cache:
|
if use_cache:
|
||||||
cached_data = self.cache_manager.get_with_auto_strategy(cache_key)
|
cached_data = self.cache_manager.get_with_auto_strategy(cache_key)
|
||||||
if cached_data:
|
if cached_data:
|
||||||
|
|||||||
Reference in New Issue
Block a user