fix: iteration node in parallel mode token count error (#11539)

Co-authored-by: Novice Lee <novicelee@NoviPro.local>
This commit is contained in:
Novice 2024-12-11 14:23:01 +08:00 committed by GitHub
parent 79a710ce98
commit 1765fe2a29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -182,7 +182,6 @@ class IterationNode(BaseNode[IterationNodeData]):
future.add_done_callback(thread_pool.task_done_callback) future.add_done_callback(thread_pool.task_done_callback)
futures.append(future) futures.append(future)
succeeded_count = 0 succeeded_count = 0
empty_count = 0
while True: while True:
try: try:
event = q.get(timeout=1) event = q.get(timeout=1)
@ -593,3 +592,4 @@ class IterationNode(BaseNode[IterationNodeData]):
parallel_mode_run_id=parallel_mode_run_id, parallel_mode_run_id=parallel_mode_run_id,
): ):
q.put(event) q.put(event)
graph_engine.graph_runtime_state.total_tokens += graph_engine_copy.graph_runtime_state.total_tokens