feat(init): integrate license validation into startup and shutdown

Call license.Init() after database initialization and before the web
server starts. Call license.Shutdown() during graceful shutdown to stop
the background check goroutine.
This commit is contained in:
kolaente 2026-03-24 19:45:52 +01:00 committed by kolaente
parent ed2632ddb2
commit 7dd664fdc4
2 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,7 @@ import (
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/cron"
"code.vikunja.io/api/pkg/initialize"
"code.vikunja.io/api/pkg/license"
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/plugins"
"code.vikunja.io/api/pkg/routes"
@ -195,6 +196,7 @@ var webCmd = &cobra.Command{
log.Fatalf("Server shutdown failed: %v", err)
}
cron.Stop()
license.Shutdown()
plugins.Shutdown()
},
}

View File

@ -25,6 +25,7 @@ import (
"code.vikunja.io/api/pkg/events"
"code.vikunja.io/api/pkg/files"
"code.vikunja.io/api/pkg/i18n"
"code.vikunja.io/api/pkg/license"
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/mail"
"code.vikunja.io/api/pkg/migration"
@ -93,6 +94,9 @@ func FullInitWithoutAsync() {
// Set Engine
InitEngines()
// Initialize license validation
license.Init()
// Start the mail daemon
mail.StartMailDaemon()