aboutsummaryrefslogtreecommitdiffstats
path: root/routers/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/init.go')
-rw-r--r--routers/init.go19
1 files changed, 8 insertions, 11 deletions
diff --git a/routers/init.go b/routers/init.go
index 4724da8627..fdf90904ce 100644
--- a/routers/init.go
+++ b/routers/init.go
@@ -47,16 +47,16 @@ func NewServices() {
// In case of problems connecting to DB, retry connection. Eg, PGSQL in Docker Container on Synology
func initDBEngine() (err error) {
log.Info("Beginning ORM engine initialization.")
- for i := 0; i < setting.DBConnectRetries; i++ {
- log.Info("ORM engine initialization attempt #%d/%d...", i+1, setting.DBConnectRetries)
+ for i := 0; i < setting.Database.DBConnectRetries; i++ {
+ log.Info("ORM engine initialization attempt #%d/%d...", i+1, setting.Database.DBConnectRetries)
if err = models.NewEngine(migrations.Migrate); err == nil {
break
- } else if i == setting.DBConnectRetries-1 {
+ } else if i == setting.Database.DBConnectRetries-1 {
return err
}
- log.Error("ORM engine initialization attempt #%d/%d failed. Error: %v", i+1, setting.DBConnectRetries, err)
- log.Info("Backing off for %d seconds", int64(setting.DBConnectBackoff/time.Second))
- time.Sleep(setting.DBConnectBackoff)
+ log.Error("ORM engine initialization attempt #%d/%d failed. Error: %v", i+1, setting.Database.DBConnectRetries, err)
+ log.Info("Backing off for %d seconds", int64(setting.Database.DBConnectBackoff/time.Second))
+ time.Sleep(setting.Database.DBConnectBackoff)
}
models.HasEngine = true
return nil
@@ -73,7 +73,7 @@ func GlobalInit() {
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
log.Trace("Custom path: %s", setting.CustomPath)
log.Trace("Log path: %s", setting.LogRootPath)
- models.LoadConfigs()
+
NewServices()
if setting.InstallLock {
@@ -102,12 +102,9 @@ func GlobalInit() {
models.InitDeliverHooks()
models.InitTestPullRequests()
}
- if models.EnableSQLite3 {
+ if setting.EnableSQLite3 {
log.Info("SQLite3 Supported")
}
- if models.EnableTiDB {
- log.Info("TiDB Supported")
- }
checkRunMode()
if setting.InstallLock && setting.SSH.StartBuiltinServer {