mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-11 21:33:00 +00:00
track data checks for NHL games to prevent looping
This commit is contained in:
@@ -682,6 +682,8 @@ class NHLRecentManager(BaseNHLManager):
|
|||||||
if current_time - self.last_update < self.update_interval:
|
if current_time - self.last_update < self.update_interval:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.last_update = current_time
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Fetch data from ESPN API
|
# Fetch data from ESPN API
|
||||||
data = self._fetch_data()
|
data = self._fetch_data()
|
||||||
@@ -712,7 +714,6 @@ class NHLRecentManager(BaseNHLManager):
|
|||||||
|
|
||||||
self.games_list = team_games
|
self.games_list = team_games
|
||||||
self.current_game = team_games[0]
|
self.current_game = team_games[0]
|
||||||
self.last_update = current_time
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.error(f"[NHL] Error updating recent games: {e}", exc_info=True)
|
self.logger.error(f"[NHL] Error updating recent games: {e}", exc_info=True)
|
||||||
@@ -765,6 +766,8 @@ class NHLUpcomingManager(BaseNHLManager):
|
|||||||
if current_time - self.last_update < self.update_interval:
|
if current_time - self.last_update < self.update_interval:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.last_update = current_time
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Fetch data from ESPN API
|
# Fetch data from ESPN API
|
||||||
data = self._fetch_data()
|
data = self._fetch_data()
|
||||||
@@ -822,7 +825,6 @@ class NHLUpcomingManager(BaseNHLManager):
|
|||||||
self.upcoming_games = new_team_games
|
self.upcoming_games = new_team_games
|
||||||
if self.upcoming_games:
|
if self.upcoming_games:
|
||||||
self.current_game = self.upcoming_games[0]
|
self.current_game = self.upcoming_games[0]
|
||||||
self.last_update = current_time
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.error(f"[NHL] Error updating upcoming games: {e}", exc_info=True)
|
self.logger.error(f"[NHL] Error updating upcoming games: {e}", exc_info=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user