-
Notifications
You must be signed in to change notification settings - Fork 997
Open
Description
func (s *workflowServer) Execute(ctx context.Context, wd *wfpb.WorkflowData) (*emptypb.Empty, error) {
if defaultFac.protocol != dtmimp.ProtocolGRPC {
return nil, status.Errorf(codes.Internal, "workflow server not inited. please call workflow.InitGrpc first")
}
tb := dtmgimp.TransBaseFromGrpc(ctx)
_, err := defaultFac.execute(tb.Op, tb.Gid, wd.Data)
return &emptypb.Empty{}, dtmgrpc.DtmError2GrpcError(err)
}
func TransBaseFromGrpc(ctx context.Context) *dtmimp.TransBase {
md, _ := metadata.FromIncomingContext(ctx)
tb := dtmimp.NewTransBase(dtmGet(md, "gid"), dtmGet(md, "trans_type"), dtmGet(md, "dtm"), dtmGet(md, "branch_id"))
tb.Op = dtmGet(md, "op")
return tb
}
defaultFac.execute(tb.Op, tb.Gid, wd.Data) 执行回调的时候,链路追踪丢失了,现在只能取巧把上下文信息放到data里面
Metadata
Metadata
Assignees
Labels
No labels