From 1f033505f69e0348735003d018601496156164c2 Mon Sep 17 00:00:00 2001 From: Gorbunov Kirill Andreevich Date: Fri, 20 Sep 2024 17:42:01 +0300 Subject: [PATCH] #348 move time.Now --- grpc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grpc.go b/grpc.go index 932b349..9a367f2 100644 --- a/grpc.go +++ b/grpc.go @@ -200,7 +200,6 @@ func (g *Server) getGrpcOptions() []grpc.ServerOption { func (g *Server) handler(srv interface{}, stream grpc.ServerStream) error { var err error - ts := time.Now() ctx := stream.Context() @@ -209,6 +208,7 @@ func (g *Server) handler(srv interface{}, stream grpc.ServerStream) error { return status.Errorf(codes.Internal, "method does not exist in context") } + ts := time.Now() var sp tracer.Span if !slices.Contains(tracer.DefaultSkipEndpoints, fullMethod) { ctx, sp = g.opts.Tracer.Start(ctx, fullMethod+" rpc-server",