diff options
Diffstat (limited to 'internal/executor/executor.go')
| -rw-r--r-- | internal/executor/executor.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/executor/executor.go b/internal/executor/executor.go index 7674fe6..f85f1ff 100644 --- a/internal/executor/executor.go +++ b/internal/executor/executor.go @@ -29,6 +29,7 @@ type Store interface { UpdateTaskSummary(taskID, summary string) error AppendTaskInteraction(taskID string, interaction task.Interaction) error UpdateTaskAgent(id string, agent task.AgentConfig) error + UpdateExecutionChangestats(execID string, stats *task.Changestats) error } // LogPather is an optional interface runners can implement to provide the log @@ -352,6 +353,14 @@ func (p *Pool) handleRunResult(ctx context.Context, t *task.Task, exec *storage. p.logger.Error("failed to update task summary", "taskID", t.ID, "error", summaryErr) } } + if exec.StdoutPath != "" { + if cs := task.ParseChangestatFromFile(exec.StdoutPath); cs != nil { + exec.Changestats = cs + if csErr := p.store.UpdateExecutionChangestats(exec.ID, cs); csErr != nil { + p.logger.Error("failed to store changestats", "execID", exec.ID, "error", csErr) + } + } + } if updateErr := p.store.UpdateExecution(exec); updateErr != nil { p.logger.Error("failed to update execution", "error", updateErr) } |
