feat: implement core backend architecture and project management services for the History API
Build and Release / release (push) Successful in 1m33s
Build and Release / release (push) Successful in 1m33s
This commit is contained in:
+9
-4
@@ -16,6 +16,7 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
@@ -114,16 +115,20 @@ func StartServer() {
|
||||
Singleton = serverHttp
|
||||
|
||||
done := make(chan bool, 1)
|
||||
go gracefulShutdown(serverHttp, done)
|
||||
|
||||
err = serverHttp.App.Listen(fmt.Sprintf("%s:%s", serverIp, httpPort))
|
||||
err = serverHttp.App.Listen(
|
||||
fmt.Sprintf("%s:%s", serverIp, httpPort),
|
||||
fiber.ListenConfig{
|
||||
DisableStartupMessage: config.GetBoolConfigWithDefault("DISABLE_STARTUP_MESSAGE", false),
|
||||
EnablePrefork: config.GetBoolConfigWithDefault("ENABLE_PREFORK", false),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
log.Error().Msgf("Error: app failed to start on port %s, %v", httpPort, err)
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Run graceful shutdown in a separate goroutine
|
||||
go gracefulShutdown(serverHttp, done)
|
||||
|
||||
// Wait for the graceful shutdown to complete
|
||||
<-done
|
||||
log.Info().Msg("Graceful shutdown complete.")
|
||||
|
||||
Reference in New Issue
Block a user