PATH = data/gitea.db
; For "sqlite3" only. Query timeout
SQLITE_TIMEOUT = 500
+; For iterate buffer, default is 50
+ITERATE_BUFFER_SIZE = 50
[indexer]
ISSUE_INDEXER_PATH = indexers/issues.bleve
}
)
- return x.Where("id > 0").Iterate(new(Repository),
+ return x.Where("id > 0").BufferSize(setting.IterateBufferSize).Iterate(new(Repository),
func(idx int, bean interface{}) error {
repo := bean.(*Repository)
user := new(User)
}
)
- return x.Where("id > 0").Iterate(new(Repository),
+ return x.Where("id > 0").BufferSize(setting.IterateBufferSize).Iterate(new(Repository),
func(idx int, bean interface{}) error {
repo := bean.(*Repository)
user := new(User)
hookTpl = fmt.Sprintf("#!/usr/bin/env %s\ndata=$(cat)\nexitcodes=\"\"\nhookname=$(basename $0)\nGIT_DIR=${GIT_DIR:-$(dirname $0)}\n\nfor hook in ${GIT_DIR}/hooks/${hookname}.d/*; do\ntest -x \"${hook}\" || continue\necho \"${data}\" | \"${hook}\"\nexitcodes=\"${exitcodes} $?\"\ndone\n\nfor i in ${exitcodes}; do\n[ ${i} -eq 0 ] || exit ${i}\ndone\n", setting.ScriptType)
)
- return x.Where("id > 0").Iterate(new(Repository),
+ return x.Where("id > 0").BufferSize(setting.IterateBufferSize).Iterate(new(Repository),
func(idx int, bean interface{}) error {
repo := bean.(*Repository)
user := new(User)
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)
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)
}
// Delete all local copies of repository wiki that user owns.
- if err = x.
+ if err = x.BufferSize(setting.IterateBufferSize).
Where("owner_id=?", u.ID).
Iterate(new(Repository), func(idx int, bean interface{}) error {
repo := bean.(*Repository)
ShowFooterTemplateLoadTime bool
// Global setting objects
- Cfg *ini.File
- CustomPath string // Custom directory path
- CustomConf string
- CustomPID string
- ProdMode bool
- RunUser string
- IsWindows bool
- HasRobotsTxt bool
- InternalToken string // internal access token
+ Cfg *ini.File
+ CustomPath string // Custom directory path
+ CustomConf string
+ CustomPID string
+ ProdMode bool
+ RunUser string
+ IsWindows bool
+ HasRobotsTxt bool
+ InternalToken string // internal access token
+ IterateBufferSize int
)
// DateLang transforms standard language locale name to corresponding value in datetime plugin.
log.Fatal(4, "Error saving generated JWT Secret to custom config: %v", err)
}
}
+ IterateBufferSize = Cfg.Section("database").Key("ITERATE_BUFFER_SIZE").MustInt(50)
sec = Cfg.Section("attachment")
AttachmentPath = sec.Key("PATH").MustString(path.Join(AppDataPath, "attachments"))