Skip to content

Commit

Permalink
callback is nil not trace
Browse files Browse the repository at this point in the history
  • Loading branch information
lbbniu committed Apr 26, 2023
1 parent 4f7a65a commit e4e84d2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tars/tools/tars2go/gen_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,9 @@ func (gen *GenGo) genIFProxyFun(interfName string, fun *FunInfo, withContext boo

// trace
if !isOneWay && !withoutTrace {
if isAsync {
c.WriteString(`if callback != nil {`)
}
c.WriteString(`
trace, ok := current.GetTarsTrace(tarsCtx)
if ok && trace.Call() {
Expand All @@ -1280,6 +1283,9 @@ if ok && trace.Call() {
}
tars.Trace(trace.GetTraceKey(tarstrace.EstCS), tarstrace.AnnotationCS, tars.GetClientConfig().ModuleName, obj.servant.Name(), "` + fun.Name + `", 0, traceParam, "")
}`)
if isAsync {
c.WriteString(`}`)
}
c.WriteString("\n\n")
}
c.WriteString(`var statusMap map[string]string
Expand Down

0 comments on commit e4e84d2

Please sign in to comment.