fix log streaming
This commit is contained in:
parent
7e8f3ef103
commit
aa7d6aada3
2
codec.go
2
codec.go
@ -180,5 +180,5 @@ func (g *grpcCodec) Close() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g *grpcCodec) String() string {
|
func (g *grpcCodec) String() string {
|
||||||
return g.c.Name()
|
return "grpc"
|
||||||
}
|
}
|
||||||
|
3
grpc.go
3
grpc.go
@ -248,6 +248,7 @@ func (g *grpcServer) handler(srv interface{}, stream grpc.ServerStream) error {
|
|||||||
contentType: ct,
|
contentType: ct,
|
||||||
method: fmt.Sprintf("%s.%s", serviceName, methodName),
|
method: fmt.Sprintf("%s.%s", serviceName, methodName),
|
||||||
codec: codec,
|
codec: codec,
|
||||||
|
stream: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
response := &rpcResponse{
|
response := &rpcResponse{
|
||||||
@ -385,9 +386,11 @@ func (g *grpcServer) processRequest(stream grpc.ServerStream, service *service,
|
|||||||
}
|
}
|
||||||
return status.New(statusCode, statusDesc).Err()
|
return status.New(statusCode, statusDesc).Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := stream.SendMsg(replyv.Interface()); err != nil {
|
if err := stream.SendMsg(replyv.Interface()); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return status.New(statusCode, statusDesc).Err()
|
return status.New(statusCode, statusDesc).Err()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user