Skip to content

Commit 7e85cba

Browse files
authored
Print usefull error if SQLite is used in settings but not supported (go-gitea#14476) (go-gitea#14874)
* move log output to points where they are relefant * check explicit of sqlite3 in settings
1 parent 26628aa commit 7e85cba

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

routers/init.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,19 @@ func GlobalInit(ctx context.Context) {
133133
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
134134
log.Trace("Custom path: %s", setting.CustomPath)
135135
log.Trace("Log path: %s", setting.LogRootPath)
136+
checkRunMode()
136137

137138
// Setup i18n
138139
InitLocales()
139140

140141
NewServices()
141142

143+
if setting.EnableSQLite3 {
144+
log.Info("SQLite3 Supported")
145+
} else if setting.Database.UseSQLite3 {
146+
log.Fatal("SQLite3 is set in settings but NOT Supported")
147+
}
148+
142149
if setting.InstallLock {
143150
highlight.NewContext()
144151
external.RegisterParsers()
@@ -172,10 +179,6 @@ func GlobalInit(ctx context.Context) {
172179
}
173180
eventsource.GetManager().Init()
174181
}
175-
if setting.EnableSQLite3 {
176-
log.Info("SQLite3 Supported")
177-
}
178-
checkRunMode()
179182

180183
if err := repo_migrations.Init(); err != nil {
181184
log.Fatal("Failed to initialize repository migrations: %v", err)

0 commit comments

Comments
 (0)