增加链路追踪配置,优化服务退出流程,gf版本升级到v2.4.2

This commit is contained in:
孟帅
2023-06-09 19:13:26 +08:00
parent 48f8c20d9c
commit 05e85f52e7
16 changed files with 94 additions and 33 deletions

View File

@@ -13,6 +13,7 @@ import (
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/os/glog"
"hotgo/internal/consts"
"hotgo/utility/simple"
"reflect"
"sync"
"time"
@@ -61,12 +62,13 @@ func NewServer(config *ServerConfig) (server *Server, err error) {
return
}
if config.Name == "" {
config.Name = "hotgo"
}
server = new(Server)
server.Ctx = gctx.New()
if config.Name == "" {
config.Name = simple.AppName(server.Ctx)
}
server.addr = config.Addr
server.name = config.Name
server.ln = gtcp.NewServer(server.addr, server.accept, config.Name)