diff --git a/invokeai/app/services/invocation_stats/invocation_stats_default.py b/invokeai/app/services/invocation_stats/invocation_stats_default.py index 501a4c04e5..be58aaad2d 100644 --- a/invokeai/app/services/invocation_stats/invocation_stats_default.py +++ b/invokeai/app/services/invocation_stats/invocation_stats_default.py @@ -106,9 +106,9 @@ class InvocationStatsService(InvocationStatsServiceBase): del self._stats[graph_execution_state_id] del self._cache_stats[graph_execution_state_id] except KeyError as e: - msg = f"Attempted to clear statistics for unknown graph {graph_execution_state_id}: {e}." - logger.error(msg) - raise GESStatsNotFoundError(msg) from e + raise GESStatsNotFoundError( + f"Attempted to clear statistics for unknown graph {graph_execution_state_id}: {e}." + ) from e def get_stats(self, graph_execution_state_id: str) -> InvocationStatsSummary: graph_stats_summary = self._get_graph_summary(graph_execution_state_id) @@ -136,9 +136,9 @@ class InvocationStatsService(InvocationStatsServiceBase): try: cache_stats = self._cache_stats[graph_execution_state_id] except KeyError as e: - msg = f"Attempted to get model cache statistics for unknown graph {graph_execution_state_id}: {e}." - logger.error(msg) - raise GESStatsNotFoundError(msg) from e + raise GESStatsNotFoundError( + f"Attempted to get model cache statistics for unknown graph {graph_execution_state_id}: {e}." + ) from e return ModelCacheStatsSummary( cache_hits=cache_stats.hits, @@ -154,9 +154,9 @@ class InvocationStatsService(InvocationStatsServiceBase): try: graph_stats = self._stats[graph_execution_state_id] except KeyError as e: - msg = f"Attempted to get graph statistics for unknown graph {graph_execution_state_id}: {e}." - logger.error(msg) - raise GESStatsNotFoundError(msg) from e + raise GESStatsNotFoundError( + f"Attempted to get graph statistics for unknown graph {graph_execution_state_id}: {e}." + ) from e return graph_stats.get_graph_stats_summary(graph_execution_state_id) @@ -164,8 +164,8 @@ class InvocationStatsService(InvocationStatsServiceBase): try: graph_stats = self._stats[graph_execution_state_id] except KeyError as e: - msg = f"Attempted to get node statistics for unknown graph {graph_execution_state_id}: {e}." - logger.error(msg) - raise GESStatsNotFoundError(msg) from e + raise GESStatsNotFoundError( + f"Attempted to get node statistics for unknown graph {graph_execution_state_id}: {e}." + ) from e return graph_stats.get_node_stats_summaries()