修复字典选项和公告提示加载异常,优化tcp和websocket消息处理

This commit is contained in:
孟帅
2023-06-25 19:22:08 +08:00
parent 773f26b479
commit 4a06a895b3
15 changed files with 114 additions and 53 deletions

View File

@@ -12,14 +12,13 @@ import (
)
// initCtx 初始化上下文对象指针到上下文对象中,以便后续的请求流程中可以修改
func initCtx(ctx context.Context, model *Context) (newCtx context.Context, cancel context.CancelFunc) {
func initCtx(ctx context.Context, model *Context) (newCtx context.Context) {
if model.TraceID != "" {
newCtx, _ = gtrace.WithTraceID(ctx, model.TraceID)
} else {
newCtx = ctx
}
newCtx = context.WithValue(newCtx, consts.ContextTCPKey, model)
newCtx, cancel = context.WithCancel(newCtx)
return
}