Skip to content

Commit 0cc6d31

Browse files
committed
rename func
1 parent 948f650 commit 0cc6d31

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

services/actions/notifier_helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ func handleWorkflows(
344344

345345
run.NeedApproval = need
346346

347-
if err := PrepareRun(ctx, dwf.Content, run, nil); err != nil {
347+
if err := PrepareRunAndInsert(ctx, dwf.Content, run, nil); err != nil {
348348
log.Error("PrepareRun: %v", err)
349349
continue
350350
}

services/actions/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import (
1717
"gopkg.in/yaml.v3"
1818
)
1919

20-
// PrepareRun prepares a run and inserts it into the database
20+
// PrepareRunAndInsert prepares a run and inserts it into the database
2121
// It parses the workflow content, evaluates concurrency if needed, and inserts the run and its jobs into the database.
2222
// The title will be cut off at 255 characters if it's longer than 255 characters.
23-
func PrepareRun(ctx context.Context, content []byte, run *actions_model.ActionRun, inputsWithDefaults map[string]any) error {
23+
func PrepareRunAndInsert(ctx context.Context, content []byte, run *actions_model.ActionRun, inputsWithDefaults map[string]any) error {
2424
if err := run.LoadAttributes(ctx); err != nil {
2525
return fmt.Errorf("LoadAttributes: %w", err)
2626
}

services/actions/schedule_tasks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func CreateScheduleTask(ctx context.Context, cron *actions_model.ActionSchedule)
119119
// FIXME cron.Content might be outdated if the workflow file has been changed.
120120
// Load the latest sha from default branch
121121
// Insert the action run and its associated jobs into the database
122-
if err := PrepareRun(ctx, cron.Content, run, nil); err != nil {
122+
if err := PrepareRunAndInsert(ctx, cron.Content, run, nil); err != nil {
123123
return err
124124
}
125125

services/actions/workflow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func DispatchActionWorkflow(ctx reqctx.RequestContext, doer *user_model.User, re
166166
run.EventPayload = string(eventPayload)
167167

168168
// Insert the action run and its associated jobs into the database
169-
if err := PrepareRun(ctx, content, run, inputsWithDefaults); err != nil {
169+
if err := PrepareRunAndInsert(ctx, content, run, inputsWithDefaults); err != nil {
170170
return fmt.Errorf("PrepareRun: %w", err)
171171
}
172172
return nil

0 commit comments

Comments
 (0)