]> source.dussan.org Git - gitea.git/commitdiff
Print usefull error if SQLite is used in settings but not supported (#14476) (#14874)
author6543 <6543@obermui.de>
Wed, 3 Mar 2021 21:54:32 +0000 (22:54 +0100)
committerGitHub <noreply@github.com>
Wed, 3 Mar 2021 21:54:32 +0000 (21:54 +0000)
* move log output to points where they are relefant

* check explicit of sqlite3 in settings

routers/init.go

index 608db79cb056cb2b12bfb99ad3636f3a408a8f13..8265c55852214b6746035198d8964108e9cb3573 100644 (file)
@@ -133,12 +133,19 @@ func GlobalInit(ctx context.Context) {
        log.Trace("AppWorkPath: %s", setting.AppWorkPath)
        log.Trace("Custom path: %s", setting.CustomPath)
        log.Trace("Log path: %s", setting.LogRootPath)
+       checkRunMode()
 
        // Setup i18n
        InitLocales()
 
        NewServices()
 
+       if setting.EnableSQLite3 {
+               log.Info("SQLite3 Supported")
+       } else if setting.Database.UseSQLite3 {
+               log.Fatal("SQLite3 is set in settings but NOT Supported")
+       }
+
        if setting.InstallLock {
                highlight.NewContext()
                external.RegisterParsers()
@@ -172,10 +179,6 @@ func GlobalInit(ctx context.Context) {
                }
                eventsource.GetManager().Init()
        }
-       if setting.EnableSQLite3 {
-               log.Info("SQLite3 Supported")
-       }
-       checkRunMode()
 
        if err := repo_migrations.Init(); err != nil {
                log.Fatal("Failed to initialize repository migrations: %v", err)