1
0
Fork 0
forked from forgejo/forgejo

Make db connect more robust (#5738)

This commit is contained in:
Paul Brackin 2019-01-19 13:17:08 -08:00 committed by techknowlogick
parent f54e0d2f16
commit 1bb22b2b47
4 changed files with 41 additions and 10 deletions

View file

@ -169,12 +169,14 @@ var (
DisableGitHooks bool
// Database settings
UseSQLite3 bool
UseMySQL bool
UseMSSQL bool
UsePostgreSQL bool
UseTiDB bool
LogSQL bool
UseSQLite3 bool
UseMySQL bool
UseMSSQL bool
UsePostgreSQL bool
UseTiDB bool
LogSQL bool
DBConnectRetries int
DBConnectBackoff time.Duration
// Indexer settings
Indexer struct {
@ -986,6 +988,8 @@ func NewContext() {
}
IterateBufferSize = Cfg.Section("database").Key("ITERATE_BUFFER_SIZE").MustInt(50)
LogSQL = Cfg.Section("database").Key("LOG_SQL").MustBool(true)
DBConnectRetries = Cfg.Section("database").Key("DB_RETRIES").MustInt(10)
DBConnectBackoff = Cfg.Section("database").Key("DB_RETRY_BACKOFF").MustDuration(3 * time.Second)
sec = Cfg.Section("attachment")
AttachmentPath = sec.Key("PATH").MustString(path.Join(AppDataPath, "attachments"))