feat:统一节点进度事件

This commit is contained in:
2026-09-29 00:47:57 +08:00
parent 437fcd74b1
commit 2b029b4bc7
6 changed files with 141 additions and 9 deletions
+5 -2
View File
@@ -10,6 +10,7 @@ from pydantic import ValidationError
if TYPE_CHECKING:
from app.config import Settings
from app.exceptions import AppError, ImportProcessError
from app.processor.progress import node_progress
T = TypeVar("T")
@@ -37,7 +38,8 @@ class BaseNode(ABC):
start_time = time.perf_counter()
self.logger.info("节点开始")
try:
result = self.process(state)
with node_progress(self.name, state):
result = self.process(state)
except GraphInterrupt:
raise
except (AppError, ValidationError):
@@ -61,7 +63,8 @@ class BaseNode(ABC):
start_time = time.perf_counter()
self.logger.info("节点开始")
try:
result = await self.process(state)
with node_progress(self.name, state):
result = await self.process(state)
except GraphInterrupt:
raise
except (AppError, ValidationError):