mirror of
https://github.com/go-gitea/gitea
synced 2025-09-28 03:28:13 +00:00
Improve ui for builds
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"hash/fnv"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/core"
|
||||
"code.gitea.io/gitea/models/db"
|
||||
@@ -84,6 +85,10 @@ func (r *Run) LoadAttributes(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (run *Run) TakeTime() time.Duration {
|
||||
return run.EndTime.AsTime().Sub(run.StartTime.AsTime())
|
||||
}
|
||||
|
||||
func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) error {
|
||||
_, err := db.GetEngine(ctx).ID(repo.ID).
|
||||
SetExpr("num_runs",
|
||||
|
Reference in New Issue
Block a user