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 /modules/setting | |
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 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 10c301aa2a..0bd73b8cba 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -480,15 +480,16 @@ var ( 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. @@ -873,6 +874,7 @@ func NewContext() { 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")) |