Skip to content
Snippets Groups Projects
Commit 0e571877 authored by flycash's avatar flycash
Browse files

Fix review

parent 3db2f4dc
No related branches found
No related tags found
No related merge requests found
...@@ -331,16 +331,15 @@ func (h *RpcServerHandler) OnCron(session getty.Session) { ...@@ -331,16 +331,15 @@ func (h *RpcServerHandler) OnCron(session getty.Session) {
} }
} }
// rebuild the context by attachment. // rebuildCtx rebuild the context by attachment.
// Once we decided to transfer more context's key-value, we should change this. // Once we decided to transfer more context's key-value, we should change this.
// now we only support rebuild the tracing context // now we only support rebuild the tracing context
func rebuildCtx(inv *invocation.RPCInvocation) context.Context { func rebuildCtx(inv *invocation.RPCInvocation) context.Context {
ctx := context.Background() ctx := context.Background()
// actually, if user do not use any opentracing framework, it will always be error. // actually, if user do not use any opentracing framework, the err will not be nil.
spanCtx, err := opentracing.GlobalTracer().Extract(opentracing.TextMap, spanCtx, err := opentracing.GlobalTracer().Extract(opentracing.TextMap,
opentracing.TextMapCarrier(inv.Attachments())) opentracing.TextMapCarrier(inv.Attachments()))
if err == nil { if err == nil {
ctx = context.WithValue(ctx, constant.TRACING_REMOTE_SPAN_CTX, spanCtx) ctx = context.WithValue(ctx, constant.TRACING_REMOTE_SPAN_CTX, spanCtx)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment