Browse Source

Commits fetch concurrency (#3837)

pull/4129/head
Thibault Meyer 8 years ago committed by Unknwon
parent
commit
a45205b988
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 5
      conf/app.ini
  2. 1
      modules/setting/setting.go
  3. 2
      routers/repo/view.go

5
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.

1
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 {

2
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

Loading…
Cancel
Save