This commit is contained in:
withchao
2023-01-12 14:23:00 +08:00
parent b57616cb29
commit 3b82fbe4ca
2 changed files with 6 additions and 7 deletions
+1 -3
View File
@@ -34,9 +34,7 @@ func RpcServerInterceptor(ctx context.Context, req interface{}, info *grpc.Unary
operationID = opts[0]
}
var opUserID string
if opts := md.Get("opUserID"); len(opts) != 1 {
return nil, status.New(codes.InvalidArgument, "opUserID error").Err()
} else {
if opts := md.Get("opUserID"); len(opts) == 1 {
opUserID = opts[0]
}
ctx = trace_log.NewRpcCtx(ctx, funcName, operationID)