mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-11 07:31:51 +00:00
update InsertRun
This commit is contained in:
parent
ea2bc926f5
commit
a4b76b6544
@ -18,12 +18,7 @@ import (
|
|||||||
// InsertRun inserts a run
|
// InsertRun inserts a run
|
||||||
// The title will be cut off at 255 characters if it's longer than 255 characters.
|
// The title will be cut off at 255 characters if it's longer than 255 characters.
|
||||||
func InsertRun(ctx context.Context, run *actions_model.ActionRun, jobs []*jobparser.SingleWorkflow) error {
|
func InsertRun(ctx context.Context, run *actions_model.ActionRun, jobs []*jobparser.SingleWorkflow) error {
|
||||||
ctx, committer, err := db.TxContext(ctx)
|
return db.WithTx(ctx, func(ctx context.Context) error {
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer committer.Close()
|
|
||||||
|
|
||||||
index, err := db.GetNextResourceIndex(ctx, "action_run_index", run.RepoID)
|
index, err := db.GetNextResourceIndex(ctx, "action_run_index", run.RepoID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -94,7 +89,6 @@ func InsertRun(ctx context.Context, run *actions_model.ActionRun, jobs []*jobpar
|
|||||||
RunsOn: job.RunsOn(),
|
RunsOn: job.RunsOn(),
|
||||||
Status: status,
|
Status: status,
|
||||||
}
|
}
|
||||||
|
|
||||||
// check job concurrency
|
// check job concurrency
|
||||||
if job.RawConcurrency != nil && job.RawConcurrency.Group != "" {
|
if job.RawConcurrency != nil && job.RawConcurrency.Group != "" {
|
||||||
runJob.RawConcurrencyGroup = job.RawConcurrency.Group
|
runJob.RawConcurrencyGroup = job.RawConcurrency.Group
|
||||||
@ -143,5 +137,6 @@ func InsertRun(ctx context.Context, run *actions_model.ActionRun, jobs []*jobpar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return committer.Commit()
|
return nil
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user