Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

feat(backend): Minimize the non caught error logic between graph exec creation and queueing (#9306)

Zamil Majdya584f1fdd2b4
diff --git a/autogpt_platform/backend/backend/executor/manager.py b/autogpt_platform/backend/backend/executor/manager.py
index 9ea8c9f76d..bf3a3a740a 100644
--- a/autogpt_platform/backend/backend/executor/manager.py
+++ b/autogpt_platform/backend/backend/executor/manager.py
@@ -657,6 +657,10 @@ class Executor:
try:
queue = ExecutionQueue[NodeExecutionEntry]()
for node_exec in graph_exec.start_node_execs:
+ exec_update = cls.db_client.update_execution_status(
+ node_exec.node_exec_id, ExecutionStatus.QUEUED, node_exec.data
+ )
+ cls.db_client.send_execution_update(exec_update)
queue.add(node_exec)
running_executions: dict[str, AsyncResult] = {}
@@ -853,10 +857,6 @@ class ExecutionManager(AppService):
data=node_exec.input_data,
)
)
- exec_update = self.db_client.update_execution_status(
- node_exec.node_exec_id, ExecutionStatus.QUEUED, node_exec.input_data
- )
- self.db_client.send_execution_update(exec_update)
graph_exec = GraphExecutionEntry(
user_id=user_id,