From 01e6dfe201950b453261a40f7fd215adaf634c0a Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Wed, 29 Dec 2021 11:38:58 +0800 Subject: [PATCH 1/6] no need to wait error --- modules/storage/minio.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/storage/minio.go b/modules/storage/minio.go index c6f704df5..7b914817d 100755 --- a/modules/storage/minio.go +++ b/modules/storage/minio.go @@ -95,9 +95,7 @@ func (m *MinioStorage) DeleteDir(dir string) error { } }() - for rErr := range m.client.RemoveObjects(m.bucket, objectsCh) { - log.Error("Error detected during deletion: ", rErr) - } + m.client.RemoveObjects(m.bucket, objectsCh) return nil } From 4e4e6d150c9143ca989e3d15c4369088c2995a37 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Wed, 29 Dec 2021 14:44:20 +0800 Subject: [PATCH 2/6] fix issue --- web_src/less/openi.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/less/openi.less b/web_src/less/openi.less index dcde874be..2c92a5f8d 100644 --- a/web_src/less/openi.less +++ b/web_src/less/openi.less @@ -232,7 +232,7 @@ footer .column{margin-bottom:0!important; padding-bottom:0!important;} .i-bg-used{background-position: -514px -52px;} .icon-bind{background-position: -550px -52px;} .icon-unbind{background-position: -568px -52px;} -.CREATING, .STOPPING, .DELETING, .STARTING, .WAITING ,.INIT,.KILLING{display:inline-block;background-image:url('/img/loading.gif');background-repeat:no-repeat;width:16px;height:16px;background-size:16px 16px;margin-right:5px;} +.CREATING, .STOPPING, .DELETING, .STARTING, i .WAITING ,.INIT,.KILLING{display:inline-block;background-image:url('/img/loading.gif');background-repeat:no-repeat;width:16px;height:16px;background-size:16px 16px;margin-right:5px;} .COMPLETED{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -441px -52px;} .text_over{ From 60776f0e9e489bbfb3cde33da36ee21c4bf7ee4c Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Wed, 29 Dec 2021 16:12:23 +0800 Subject: [PATCH 3/6] fix issue --- web_src/less/openi.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/less/openi.less b/web_src/less/openi.less index 2c92a5f8d..9109f75f0 100644 --- a/web_src/less/openi.less +++ b/web_src/less/openi.less @@ -232,7 +232,7 @@ footer .column{margin-bottom:0!important; padding-bottom:0!important;} .i-bg-used{background-position: -514px -52px;} .icon-bind{background-position: -550px -52px;} .icon-unbind{background-position: -568px -52px;} -.CREATING, .STOPPING, .DELETING, .STARTING, i .WAITING ,.INIT,.KILLING{display:inline-block;background-image:url('/img/loading.gif');background-repeat:no-repeat;width:16px;height:16px;background-size:16px 16px;margin-right:5px;} +.CREATING, .STOPPING, .DELETING, .STARTING, i.WAITING ,.INIT,.KILLING{display:inline-block;background-image:url('/img/loading.gif');background-repeat:no-repeat;width:16px;height:16px;background-size:16px 16px;margin-right:5px;} .COMPLETED{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -441px -52px;} .text_over{ From 8e94a039109f1150252ac322e04d6067ff56277c Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Thu, 30 Dec 2021 09:47:54 +0800 Subject: [PATCH 4/6] add log --- modules/context/repo.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/context/repo.go b/modules/context/repo.go index de494c1bc..4da6e9a16 100755 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -11,6 +11,7 @@ import ( "net/url" "path" "strings" + "time" "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/cache" @@ -517,6 +518,7 @@ func RepoAssignment() macaron.Handler { return } + startTime := time.Now() tags, err := ctx.Repo.GitRepo.GetTags() if err != nil { ctx.ServerError("GetTags", err) @@ -524,11 +526,17 @@ func RepoAssignment() macaron.Handler { } ctx.Data["Tags"] = tags + duration := time.Since(startTime) + log.Info("GetTags cost: %v seconds", duration.Seconds()) brs, _, err := ctx.Repo.GitRepo.GetBranches(0, 0) if err != nil { ctx.ServerError("GetBranches", err) return } + + duration = time.Since(startTime) + log.Info("GetBranches cost: %v seconds", duration.Seconds()) + ctx.Data["Branches"] = brs ctx.Data["BranchesCount"] = len(brs) From ed5cfca0214583f587e4debcc5afe24e07459a43 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Thu, 30 Dec 2021 14:10:33 +0800 Subject: [PATCH 5/6] debug log --- routers/repo/issue.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 7ab5eb283..42a6b9609 100755 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -13,6 +13,7 @@ import ( "net/http" "strconv" "strings" + "time" "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/auth" @@ -336,6 +337,7 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB // Issues render issues page func Issues(ctx *context.Context) { + startTime := time.Now() isPullList := ctx.Params(":type") == "pulls" if isPullList { MustAllowPulls(ctx) @@ -366,6 +368,9 @@ func Issues(ctx *context.Context) { ctx.Data["CanWriteIssuesOrPulls"] = ctx.Repo.CanWriteIssuesOrPulls(isPullList) + duration := time.Since(startTime) + log.Info("Issues cost: %v seconds", duration.Seconds()) + ctx.HTML(200, tplIssues) } From 3d1854cf4ab286faec27a6348915661409b02899 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Thu, 30 Dec 2021 16:03:53 +0800 Subject: [PATCH 6/6] fix issue --- templates/repo/header.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 138a323e1..2091610df 100755 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -51,7 +51,7 @@ {{if not .IsBeingCreated}}
-
+ {{$.CsrfTokenHtml}}
-
+ {{$.CsrfTokenHtml}}
- +