Skip to content

Commit 0940208

Browse files
committed
fix lint
1 parent d404c60 commit 0940208

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

routers/web/repo/actions/view.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,9 @@ func rerunJob(ctx *context_module.Context, job *actions_model.ActionRunJob, shou
461461
actions_service.CreateCommitStatus(ctx, job)
462462
// Sync run status with db
463463
job.Run = nil
464-
_ = job.LoadAttributes(ctx)
464+
if err := job.LoadAttributes(ctx); err != nil {
465+
return err
466+
}
465467
notify_service.WorkflowRunStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job.Run)
466468
notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil)
467469

@@ -568,7 +570,10 @@ func Cancel(ctx *context_module.Context) {
568570
job := updatedjobs[0]
569571
// Sync run status with db
570572
job.Run = nil
571-
job.LoadAttributes(ctx)
573+
if err := job.LoadAttributes(ctx); err != nil {
574+
ctx.HTTPError(http.StatusInternalServerError, err.Error())
575+
return
576+
}
572577
notify_service.WorkflowRunStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job.Run)
573578
}
574579
ctx.JSON(http.StatusOK, struct{}{})

services/actions/job_emitter.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ func checkJobsOfRun(ctx context.Context, runID int64) error {
8989
if runUpdated {
9090
// Sync run status with db
9191
jobs[0].Run = nil
92-
jobs[0].LoadAttributes(ctx)
92+
if err := jobs[0].LoadAttributes(ctx); err != nil {
93+
return err
94+
}
9395
run := jobs[0].Run
9496
notify_service.WorkflowRunStatusUpdate(ctx, run.Repo, run.TriggerUser, run)
9597
}

0 commit comments

Comments
 (0)