From 94f91543b662e2f136014333b87ba4ab357ec101 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 15 Feb 2017 04:09:07 -0500 Subject: [PATCH] Fix compilation error --- routers/repo/view.go | 2 +- vendor/github.com/gogits/git-module/tree_entry.go | 4 +++- vendor/vendor.json | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/routers/repo/view.go b/routers/repo/view.go index f073afeba..623b7fee0 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -46,7 +46,7 @@ func renderDirectory(ctx *context.Context, treeLink string) { } entries.Sort() - ctx.Data["Files"], err = entries.GetCommitsInfo(ctx.Repo.Commit, ctx.Repo.TreePath, setting.Repository.CommitsFetchConcurrency) + ctx.Data["Files"], err = entries.GetCommitsInfoWithCustomConcurrency(ctx.Repo.Commit, ctx.Repo.TreePath, setting.Repository.CommitsFetchConcurrency) if err != nil { ctx.Handle(500, "GetCommitsInfo", err) return diff --git a/vendor/github.com/gogits/git-module/tree_entry.go b/vendor/github.com/gogits/git-module/tree_entry.go index 8d2ea8e2a..545740353 100644 --- a/vendor/github.com/gogits/git-module/tree_entry.go +++ b/vendor/github.com/gogits/git-module/tree_entry.go @@ -113,6 +113,8 @@ func (tes Entries) Sort() { sort.Sort(tes) } +var defaultConcurrency = runtime.NumCPU() + type commitInfo struct { entryName string infos []interface{} @@ -136,7 +138,7 @@ func (tes Entries) GetCommitsInfoWithCustomConcurrency(commit *Commit, treePath } if maxConcurrency <= 0 { - maxConcurrency = runtime.NumCPU() + maxConcurrency = defaultConcurrency } // Length of taskChan determines how many goroutines (subprocesses) can run at the same time. diff --git a/vendor/vendor.json b/vendor/vendor.json index 903b5a16a..cf4ee883f 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -159,10 +159,10 @@ "revisionTime": "2016-08-10T03:50:02Z" }, { - "checksumSHA1": "bCfvbFm5XS4leTIpRaHEFtvaeYU=", + "checksumSHA1": "92bIqzmK6S5Pnq9HzqWva5mSDh4=", "path": "github.com/gogits/git-module", - "revision": "5ef701a1cd1e63b7037f23cf2878e5ee749207c0", - "revisionTime": "2017-02-14T22:20:55Z" + "revision": "47f896db1a82dc746d8cfd2930e4b29a2bd75e2c", + "revisionTime": "2017-02-15T09:08:23Z" }, { "checksumSHA1": "xvG+RgJODQqlmdAkHUQK2TyLR88=",