summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-10-21 14:26:23 +0800
committerGitHub <noreply@github.com>2017-10-21 14:26:23 +0800
commit985a39590ba07798dd6e6097e0c10401764c27fb (patch)
tree2f33eb1355da1561a7d74b32806e21f08da73dc3 /models/repo.go
parent2112eb87414fb0a08d77ad018ca306cfd15d5761 (diff)
downloadgitea-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.go4
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)