This commit is contained in:
Christopher Homberger
2025-03-21 21:35:22 +01:00
parent d404c60b73
commit 0940208a00
2 changed files with 10 additions and 3 deletions
+7 -2
View File
@@ -461,7 +461,9 @@ func rerunJob(ctx *context_module.Context, job *actions_model.ActionRunJob, shou
actions_service.CreateCommitStatus(ctx, job)
// Sync run status with db
job.Run = nil
_ = job.LoadAttributes(ctx)
if err := job.LoadAttributes(ctx); err != nil {
return err
}
notify_service.WorkflowRunStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job.Run)
notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil)
@@ -568,7 +570,10 @@ func Cancel(ctx *context_module.Context) {
job := updatedjobs[0]
// Sync run status with db
job.Run = nil
job.LoadAttributes(ctx)
if err := job.LoadAttributes(ctx); err != nil {
ctx.HTTPError(http.StatusInternalServerError, err.Error())
return
}
notify_service.WorkflowRunStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job.Run)
}
ctx.JSON(http.StatusOK, struct{}{})
+3 -1
View File
@@ -89,7 +89,9 @@ func checkJobsOfRun(ctx context.Context, runID int64) error {
if runUpdated {
// Sync run status with db
jobs[0].Run = nil
jobs[0].LoadAttributes(ctx)
if err := jobs[0].LoadAttributes(ctx); err != nil {
return err
}
run := jobs[0].Run
notify_service.WorkflowRunStatusUpdate(ctx, run.Repo, run.TriggerUser, run)
}