Basic server app with WS connection.
Some checks failed
Linting and tests / Linting (push) Failing after 37s
Some checks failed
Linting and tests / Linting (push) Failing after 37s
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
|
||||
"bunker/commons"
|
||||
"bunker/server/internal/application"
|
||||
"bunker/server/internal/services/core/database"
|
||||
"bunker/server/internal/services/core/httpserver"
|
||||
"bunker/server/internal/services/core/options"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -26,6 +30,16 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
checkError(lgr, database.Initialize(app))
|
||||
checkError(lgr, options.Initialize(app))
|
||||
checkError(lgr, httpserver.Initialize(app))
|
||||
|
||||
if err := app.Start(); err != nil {
|
||||
lgr.Error("Failed to start bunkerd", "error", err.Error())
|
||||
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
lgr.Info("bunkerd started.")
|
||||
|
||||
<-app.ShutdownChan()
|
||||
@@ -37,3 +51,13 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func checkError(logger *slog.Logger, err error) {
|
||||
if err == nil {
|
||||
return
|
||||
}
|
||||
|
||||
logger.Error("Failed to initialize bunkerd.", "error", err.Error())
|
||||
|
||||
os.Exit(2)
|
||||
}
|
||||
|
Reference in New Issue
Block a user