aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Meyer <meyer.thibault@gmail.com>2017-02-15 03:59:53 -0500
committerUnknwon <u@gogs.io>2017-02-15 03:59:53 -0500
commita45205b988b3d41793774bb132e60069deefb903 (patch)
treef461666097a3ee583c12361f84c4bc6d447db5ed
parentec9c14c09d1003792955be0baba34d68944e2950 (diff)
Commits fetch concurrency (#3837)
-rw-r--r--conf/app.ini5
-rw-r--r--modules/setting/setting.go1
-rw-r--r--routers/repo/view.go2
3 files changed, 7 insertions, 1 deletions
diff --git a/conf/app.ini b/conf/app.ini
index cf3bcb83..6f612490 100644
--- a/conf/app.ini
+++ b/conf/app.ini
@@ -31,6 +31,11 @@ PREFERRED_LICENSES = Apache License 2.0,MIT License
DISABLE_HTTP_GIT = false
; Enable ability to migrate repository by local path
ENABLE_LOCAL_PATH_MIGRATION = false
+; Concurrency is used to retrieve commits information. This variable define
+; the maximum number of tasks that can be run at the same time. Usually, the
+; value depend of how many CPUs (cores) you have. If the value is set to zero
+; or under, GOGS will automatically detect the number of CPUs your system have
+COMMITS_FETCH_CONCURRENCY = 0
[repository.editor]
; List of file extensions that should have line wraps in the CodeMirror editor.
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 0c7dcc65..3b1b7250 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -126,6 +126,7 @@ var (
PreferredLicenses []string
DisableHTTPGit bool `ini:"DISABLE_HTTP_GIT"`
EnableLocalPathMigration bool
+ CommitsFetchConcurrency int
// Repository editor settings
Editor struct {
diff --git a/routers/repo/view.go b/routers/repo/view.go
index e66575c9..f073afeb 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)
+ ctx.Data["Files"], err = entries.GetCommitsInfo(ctx.Repo.Commit, ctx.Repo.TreePath, setting.Repository.CommitsFetchConcurrency)
if err != nil {
ctx.Handle(500, "GetCommitsInfo", err)
return