Skip to content

Commit b2c20b6

Browse files
authored
Print usefull error if SQLite is used in settings but not supported (#14476)
* move log output to points where they are relefant * check explicit of sqlite3 in settings
1 parent 5845c87 commit b2c20b6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

routers/init.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ func GlobalInit(ctx context.Context) {
126126
if !setting.InstallLock {
127127
log.Fatal("Gitea is not installed")
128128
}
129+
129130
if err := git.Init(ctx); err != nil {
130131
log.Fatal("Git module init failed: %v", err)
131132
}
@@ -134,6 +135,7 @@ func GlobalInit(ctx context.Context) {
134135
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
135136
log.Trace("Custom path: %s", setting.CustomPath)
136137
log.Trace("Log path: %s", setting.LogRootPath)
138+
checkRunMode()
137139

138140
// Setup i18n
139141
translation.InitLocales()
@@ -143,6 +145,12 @@ func GlobalInit(ctx context.Context) {
143145
highlight.NewContext()
144146
external.RegisterParsers()
145147
markup.Init()
148+
149+
if setting.EnableSQLite3 {
150+
log.Info("SQLite3 Supported")
151+
} else if setting.Database.UseSQLite3 {
152+
log.Fatal("SQLite3 is set in settings but NOT Supported")
153+
}
146154
if err := initDBEngine(ctx); err == nil {
147155
log.Info("ORM engine initialization successful!")
148156
} else {
@@ -175,11 +183,6 @@ func GlobalInit(ctx context.Context) {
175183
}
176184
eventsource.GetManager().Init()
177185

178-
if setting.EnableSQLite3 {
179-
log.Info("SQLite3 Supported")
180-
}
181-
checkRunMode()
182-
183186
if setting.SSH.StartBuiltinServer {
184187
ssh.Listen(setting.SSH.ListenHost, setting.SSH.ListenPort, setting.SSH.ServerCiphers, setting.SSH.ServerKeyExchanges, setting.SSH.ServerMACs)
185188
log.Info("SSH server started on %s:%d. Cipher list (%v), key exchange algorithms (%v), MACs (%v)", setting.SSH.ListenHost, setting.SSH.ListenPort, setting.SSH.ServerCiphers, setting.SSH.ServerKeyExchanges, setting.SSH.ServerMACs)

0 commit comments

Comments
 (0)