1
1
mirror of https://github.com/go-gitea/gitea synced 2025-11-01 11:58:25 +00:00

Support bot site

This commit is contained in:
Lunny Xiao
2022-11-16 19:20:52 +08:00
committed by Jason Song
parent 7059cd7265
commit 9a45572ce2
6 changed files with 24 additions and 20 deletions

View File

@@ -136,17 +136,21 @@ func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) err
// InsertRun inserts a bot run
func InsertRun(run *Run, jobs []*jobparser.SingleWorkflow) error {
index, err := db.GetNextResourceIndex("bots_run_index", run.RepoID)
ctx, commiter, err := db.TxContext(db.DefaultContext)
if err != nil {
return err
}
defer commiter.Close()
index, err := db.GetNextResourceIndex(ctx, "bots_run_index", run.RepoID)
if err != nil {
return err
}
run.Index = index
ctx, commiter, err := db.TxContext()
if err != nil {
return err
if run.Status == StatusUnknown {
run.Status = StatusWaiting
}
defer commiter.Close()
if err := db.Insert(ctx, run); err != nil {
return err