Handle bad id in log_stats(...).

This commit is contained in:
Ryan Dick 2024-01-11 15:52:12 -05:00 committed by Kent Keirsey
parent aa45d21fd2
commit 296c861e7d

View File

@ -98,8 +98,12 @@ class InvocationStatsService(InvocationStatsServiceBase):
logger.warning(f"Attempted to clear statistics for unknown graph {graph_execution_state_id}: {e}.")
def log_stats(self, graph_execution_state_id: str):
graph_stats = self._stats[graph_execution_state_id]
cache_stats = self._cache_stats[graph_execution_state_id]
try:
graph_stats = self._stats[graph_execution_state_id]
cache_stats = self._cache_stats[graph_execution_state_id]
except KeyError as e:
logger.warning(f"Attempted to log statistics for unknown graph {graph_execution_state_id}: {e}.")
return
log = graph_stats.get_pretty_log(graph_execution_state_id)