| @@ -11,6 +11,7 @@ import ( | |||||
| "net/url" | "net/url" | ||||
| "path" | "path" | ||||
| "strings" | "strings" | ||||
| "time" | |||||
| "code.gitea.io/gitea/models" | "code.gitea.io/gitea/models" | ||||
| "code.gitea.io/gitea/modules/cache" | "code.gitea.io/gitea/modules/cache" | ||||
| @@ -517,6 +518,7 @@ func RepoAssignment() macaron.Handler { | |||||
| return | return | ||||
| } | } | ||||
| startTime := time.Now() | |||||
| tags, err := ctx.Repo.GitRepo.GetTags() | tags, err := ctx.Repo.GitRepo.GetTags() | ||||
| if err != nil { | if err != nil { | ||||
| ctx.ServerError("GetTags", err) | ctx.ServerError("GetTags", err) | ||||
| @@ -524,11 +526,17 @@ func RepoAssignment() macaron.Handler { | |||||
| } | } | ||||
| ctx.Data["Tags"] = tags | ctx.Data["Tags"] = tags | ||||
| duration := time.Since(startTime) | |||||
| log.Info("GetTags cost: %v seconds", duration.Seconds()) | |||||
| brs, _, err := ctx.Repo.GitRepo.GetBranches(0, 0) | brs, _, err := ctx.Repo.GitRepo.GetBranches(0, 0) | ||||
| if err != nil { | if err != nil { | ||||
| ctx.ServerError("GetBranches", err) | ctx.ServerError("GetBranches", err) | ||||
| return | return | ||||
| } | } | ||||
| duration = time.Since(startTime) | |||||
| log.Info("GetBranches cost: %v seconds", duration.Seconds()) | |||||
| ctx.Data["Branches"] = brs | ctx.Data["Branches"] = brs | ||||
| ctx.Data["BranchesCount"] = len(brs) | ctx.Data["BranchesCount"] = len(brs) | ||||