Skip to content

Commit

Permalink
fix: add logging for missing edge mapping in StreamProcessor (#12008)
Browse files Browse the repository at this point in the history
Signed-off-by: -LAN- <[email protected]>
  • Loading branch information
laipz8200 authored Dec 23, 2024
1 parent 425cc1e commit 75bce28
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/core/workflow/nodes/answer/base_stream_processor.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import logging
from abc import ABC, abstractmethod
from collections.abc import Generator

from core.workflow.entities.variable_pool import VariablePool
from core.workflow.graph_engine.entities.event import GraphEngineEvent, NodeRunSucceededEvent
from core.workflow.graph_engine.entities.graph import Graph

logger = logging.getLogger(__name__)


class StreamProcessor(ABC):
def __init__(self, graph: Graph, variable_pool: VariablePool) -> None:
Expand All @@ -31,6 +34,9 @@ def _remove_unreachable_nodes(self, event: NodeRunSucceededEvent) -> None:
if run_result.edge_source_handle:
reachable_node_ids = []
unreachable_first_node_ids = []
if finished_node_id not in self.graph.edge_mapping:
logger.warning(f"node {finished_node_id} has no edge mapping")
return
for edge in self.graph.edge_mapping[finished_node_id]:
if (
edge.run_condition
Expand Down

0 comments on commit 75bce28

Please sign in to comment.