mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 15:10:43 +02:00
Improve ui for builds
This commit is contained in:
1 parent
d69423a3b0
commit
3518c098b9
6 files changed
+75
-47
No files matched your search
@@ -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