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.

fix(backend): Fix walltime & cputime stats on interrupted execution

Zamil Majdyc736d401a6cb
diff --git a/autogpt_platform/backend/backend/executor/manager.py b/autogpt_platform/backend/backend/executor/manager.py
index 7538c70553..bed74b1737 100644
--- a/autogpt_platform/backend/backend/executor/manager.py
+++ b/autogpt_platform/backend/backend/executor/manager.py
@@ -640,9 +640,9 @@ class Executor:
exec_meta.stats.to_db() if exec_meta.stats else GraphExecutionStats()
),
)
- exec_stats.walltime = timing_info.wall_time
- exec_stats.cputime = timing_info.cpu_time
- exec_stats.error = str(error)
+ exec_stats.walltime += timing_info.wall_time
+ exec_stats.cputime += timing_info.cpu_time
+ exec_stats.error = str(error) if error else exec_stats.error
if graph_exec_result := cls.db_client.update_graph_execution_stats(
graph_exec_id=graph_exec.graph_exec_id,