mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
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
This commit is contained in:
parent
2112eb8741
commit
985a39590b
7 changed files with 19 additions and 15 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue