diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-10-21 14:26:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-21 14:26:23 +0800 |
commit | 985a39590ba07798dd6e6097e0c10401764c27fb (patch) | |
tree | 2f33eb1355da1561a7d74b32806e21f08da73dc3 /models/repo.go | |
parent | 2112eb87414fb0a08d77ad018ca306cfd15d5761 (diff) | |
download | gitea-985a39590ba07798dd6e6097e0c10401764c27fb.tar.gz gitea-985a39590ba07798dd6e6097e0c10401764c27fb.zip |
Use buffersize to reduce database connection when iterate (#2724)
* use buffersize to reduce database connection when iterate
* fix typo
* add default value on app.ini comment
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go index 293f251d3e..1b1be62f87 100644 --- a/models/repo.go +++ b/models/repo.go @@ -2145,7 +2145,7 @@ func GitFsck() { log.Trace("Doing: GitFsck") if err := x. - Where("id>0"). + Where("id>0").BufferSize(setting.IterateBufferSize). Iterate(new(Repository), func(idx int, bean interface{}) error { repo := bean.(*Repository) @@ -2167,7 +2167,7 @@ func GitFsck() { func GitGcRepos() error { args := append([]string{"gc"}, setting.Git.GCArgs...) return x. - Where("id > 0"). + Where("id > 0").BufferSize(setting.IterateBufferSize). Iterate(new(Repository), func(idx int, bean interface{}) error { repo := bean.(*Repository) |