diff --git a/engine/api/v2_queue.go b/engine/api/v2_queue.go index b5c5ca143c..4a492de65d 100644 --- a/engine/api/v2_queue.go +++ b/engine/api/v2_queue.go @@ -188,6 +188,7 @@ func (api *API) postJobResultHandler() ([]service.RbacChecker, service.Handler) } jobRun.Status = result.Status + jobRun.Ended = time.Now() tx, err := api.mustDB().Begin() if err != nil { diff --git a/engine/api/v2_workflow_run.go b/engine/api/v2_workflow_run.go index 8130ba8b59..dfc9d85fd0 100644 --- a/engine/api/v2_workflow_run.go +++ b/engine/api/v2_workflow_run.go @@ -798,7 +798,7 @@ func restartWorkflowRun(ctx context.Context, tx gorpmapper.SqlExecutorWithTx, wr } for _, r := range runResults { duplicatedRunResult := r - duplicatedRunResult.ID = "" + duplicatedRunResult.ID = sdk.UUID() duplicatedRunResult.WorkflowRunJobID = duplicatedRJ.ID duplicatedRunResult.RunAttempt = duplicatedRJ.RunAttempt if err := workflow_v2.InsertRunResult(ctx, tx, &duplicatedRunResult); err != nil {