Skip to content

Commit 0aec839

Browse files
committed
cleanup
1 parent 678a970 commit 0aec839

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

services/actions/notifier_helper.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
api "code.gitea.io/gitea/modules/structs"
2828
webhook_module "code.gitea.io/gitea/modules/webhook"
2929
"code.gitea.io/gitea/services/convert"
30-
notify_service "code.gitea.io/gitea/services/notify"
3130

3231
"github.com/nektos/act/pkg/model"
3332
)
@@ -349,26 +348,6 @@ func handleWorkflows(
349348
log.Error("PrepareRun: %v", err)
350349
continue
351350
}
352-
353-
alljobs, err := db.Find[actions_model.ActionRunJob](ctx, actions_model.FindRunJobOptions{RunID: run.ID})
354-
if err != nil {
355-
log.Error("FindRunJobs: %v", err)
356-
continue
357-
}
358-
// FIXME PERF skip this for schedule, dispatch etc.
359-
CreateCommitStatus(ctx, alljobs...)
360-
if len(alljobs) > 0 {
361-
job := alljobs[0]
362-
err := job.LoadRun(ctx)
363-
if err != nil {
364-
log.Error("LoadRun: %v", err)
365-
continue
366-
}
367-
notify_service.WorkflowRunStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job.Run)
368-
}
369-
for _, job := range alljobs {
370-
notify_service.WorkflowJobStatusUpdate(ctx, input.Repo, input.Doer, job, nil)
371-
}
372351
}
373352
return nil
374353
}

services/actions/run.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,15 @@ func PrepareRun(ctx context.Context, content []byte, run *actions_model.ActionRu
5757
return fmt.Errorf("InsertRun: %w", err)
5858
}
5959

60+
// FIXME PERF do we need this db round trip?
6061
allJobs, err := db.Find[actions_model.ActionRunJob](ctx, actions_model.FindRunJobOptions{RunID: run.ID})
6162
if err != nil {
6263
log.Error("FindRunJobs: %v", err)
6364
}
65+
66+
// FIXME PERF skip this for schedule, dispatch etc.
67+
CreateCommitStatus(ctx, allJobs...)
68+
6469
err = run.LoadAttributes(ctx)
6570
if err != nil {
6671
log.Error("LoadAttributes: %v", err)

0 commit comments

Comments
 (0)