mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(stats): fix fail case when previous graph is invalid
When retrieving a graph, it is parsed through pydantic. It is possible that this graph is invalid, and an error is thrown. Handle this by deleting the failed graph from the stats if this occurs.
This commit is contained in:
parent
519bcb38c1
commit
81385d7d35
@ -34,6 +34,7 @@ from abc import ABC, abstractmethod
|
||||
from contextlib import AbstractContextManager
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Dict
|
||||
from pydantic import ValidationError
|
||||
|
||||
import torch
|
||||
|
||||
@ -269,7 +270,13 @@ class InvocationStatsService(InvocationStatsServiceBase):
|
||||
"""
|
||||
completed = set()
|
||||
for graph_id, node_log in self._stats.items():
|
||||
current_graph_state = self.graph_execution_manager.get(graph_id)
|
||||
try:
|
||||
current_graph_state = self.graph_execution_manager.get(graph_id)
|
||||
except ValidationError:
|
||||
del self._stats[graph_id]
|
||||
del self._cache_stats[graph_id]
|
||||
continue
|
||||
|
||||
if not current_graph_state.is_complete():
|
||||
continue
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user