🎨 Improve http server

Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-12-09 11:02:25 +08:00
parent 21dff696cc
commit 106a679dba
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 10 additions and 1 deletions

View file

@ -217,7 +217,11 @@ func Serve(fastMode bool) {
// 反代服务器启动失败不影响核心服务器启动
}()
if err = http.Serve(ln, ginServer.Handler()); err != nil {
util.HttpServer = &http.Server{
Handler: ginServer,
}
if err = util.HttpServer.Serve(ln); err != nil {
if !fastMode {
logging.LogErrorf("boot kernel failed: %s", err)
os.Exit(logging.ExitCodeUnavailablePort)