feat(app): changes to dyanmically load systems based on settings

This commit is contained in:
2025-08-05 12:40:11 -05:00
parent 4dd842b3b8
commit 2473bfa702
3 changed files with 22 additions and 16 deletions

View File

@@ -9,6 +9,7 @@ import (
"lst.net/internal/db"
"lst.net/internal/router"
"lst.net/internal/system/settings"
"lst.net/pkg/logger"
)
@@ -43,6 +44,12 @@ func main() {
}
}()
if err := settings.Initialize(db.DB); err != nil {
log.Panic("There was an error intilizing the settings", "settings", map[string]interface{}{
"error": err,
})
}
// long lived process like ocp running all the time should go here and base the db struct over.
// go ocp.MonitorPrinters
// go notifcations.Processor
@@ -54,8 +61,7 @@ func main() {
basePath = "/lst" // Dev only
}
fmt.Println("Welcome to lst backend where all the fun happens.")
log.Info("Welcome to lst backend where all the fun happens.", "system", map[string]interface{}{})
// Init Gin router and pass DB to services
r := router.Setup(db.DB, basePath, log)
@@ -66,7 +72,6 @@ func main() {
}
if err := r.Run(":" + port); err != nil {
log := logger.New()
log.Panic("Server failed to start", "system", map[string]interface{}{
"error": err,
})