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

@@ -77,10 +77,10 @@ func CancelAbandonedJobs(ctx context.Context) error {
for _, job := range jobs {
job.Status = bots_model.StatusCancelled
job.Stopped = now
if err := db.WithTx(func(ctx context.Context) error {
if err := db.WithTx(ctx, func(ctx context.Context) error {
_, err := bots_model.UpdateRunJob(ctx, job, nil, "status", "stopped")
return err
}, ctx); err != nil {
}); err != nil {
log.Warn("cancel abandoned job %v: %v", job.ID, err)
// go on
}