mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-15 20:06:03 +08:00
fix(workflow): "Max submit count reached" error occurred when executing workflow as tool in iteration (#8595)
This commit is contained in:
parent
7f3282ec04
commit
e0a3307563
@ -180,16 +180,20 @@ class GraphEngine:
|
|||||||
|
|
||||||
# trigger graph run success event
|
# trigger graph run success event
|
||||||
yield GraphRunSucceededEvent(outputs=self.graph_runtime_state.outputs)
|
yield GraphRunSucceededEvent(outputs=self.graph_runtime_state.outputs)
|
||||||
|
self._release_thread()
|
||||||
except GraphRunFailedError as e:
|
except GraphRunFailedError as e:
|
||||||
yield GraphRunFailedEvent(error=e.error)
|
yield GraphRunFailedEvent(error=e.error)
|
||||||
|
self._release_thread()
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception("Unknown Error when graph running")
|
logger.exception("Unknown Error when graph running")
|
||||||
yield GraphRunFailedEvent(error=str(e))
|
yield GraphRunFailedEvent(error=str(e))
|
||||||
|
self._release_thread()
|
||||||
raise e
|
raise e
|
||||||
finally:
|
|
||||||
if self.is_main_thread_pool and self.thread_pool_id in GraphEngine.workflow_thread_pool_mapping:
|
def _release_thread(self):
|
||||||
del GraphEngine.workflow_thread_pool_mapping[self.thread_pool_id]
|
if self.is_main_thread_pool and self.thread_pool_id in GraphEngine.workflow_thread_pool_mapping:
|
||||||
|
del GraphEngine.workflow_thread_pool_mapping[self.thread_pool_id]
|
||||||
|
|
||||||
def _run(
|
def _run(
|
||||||
self,
|
self,
|
||||||
|
@ -89,6 +89,7 @@ class IterationNode(BaseNode):
|
|||||||
variable_pool=variable_pool,
|
variable_pool=variable_pool,
|
||||||
max_execution_steps=dify_config.WORKFLOW_MAX_EXECUTION_STEPS,
|
max_execution_steps=dify_config.WORKFLOW_MAX_EXECUTION_STEPS,
|
||||||
max_execution_time=dify_config.WORKFLOW_MAX_EXECUTION_TIME,
|
max_execution_time=dify_config.WORKFLOW_MAX_EXECUTION_TIME,
|
||||||
|
thread_pool_id=self.thread_pool_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
start_at = datetime.now(timezone.utc).replace(tzinfo=None)
|
start_at = datetime.now(timezone.utc).replace(tzinfo=None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user