mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(stats): RuntimeError: dictionary changed size during iteration
This commit is contained in:
parent
165c57c001
commit
0b9ae74192
@ -259,12 +259,12 @@ class InvocationStatsService(InvocationStatsServiceBase):
|
|||||||
|
|
||||||
def log_stats(self):
|
def log_stats(self):
|
||||||
completed = set()
|
completed = set()
|
||||||
|
errored = set()
|
||||||
for graph_id, node_log in self._stats.items():
|
for graph_id, node_log in self._stats.items():
|
||||||
try:
|
try:
|
||||||
current_graph_state = self.graph_execution_manager.get(graph_id)
|
current_graph_state = self.graph_execution_manager.get(graph_id)
|
||||||
except ValidationError:
|
except Exception:
|
||||||
del self._stats[graph_id]
|
errored.add(graph_id)
|
||||||
del self._cache_stats[graph_id]
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not current_graph_state.is_complete():
|
if not current_graph_state.is_complete():
|
||||||
@ -299,3 +299,7 @@ class InvocationStatsService(InvocationStatsServiceBase):
|
|||||||
for graph_id in completed:
|
for graph_id in completed:
|
||||||
del self._stats[graph_id]
|
del self._stats[graph_id]
|
||||||
del self._cache_stats[graph_id]
|
del self._cache_stats[graph_id]
|
||||||
|
|
||||||
|
for graph_id in errored:
|
||||||
|
del self._stats[graph_id]
|
||||||
|
del self._cache_stats[graph_id]
|
||||||
|
Loading…
Reference in New Issue
Block a user