feat: update

This commit is contained in:
Rogee
2025-09-10 18:06:24 +08:00
parent 66deb69c32
commit 1306a5bec0
4 changed files with 16 additions and 20 deletions

View File

@@ -33,13 +33,6 @@ type Service struct {
func (svc *Service) listenerConfig() fiber.ListenConfig {
listenConfig := fiber.ListenConfig{
EnablePrintRoutes: true,
OnShutdownSuccess: func() {
log.Info("http server shutdown success")
},
OnShutdownError: func(err error) {
log.Error("http server shutdown error: ", err)
},
// DisableStartupMessage: true,
}
@@ -92,6 +85,14 @@ func Provide(opts ...opt.Option) error {
TimeZone: "Asia/Shanghai",
}))
engine.Hooks().OnPostShutdown(func(err error) error {
if err != nil {
log.Error("http server shutdown error: ", err)
}
log.Info("http server has shutdown success")
return nil
})
return &Service{
Engine: engine,
conf: &config,