delete grpc recovery

pull/991/head
longXboy 4 years ago
parent 92b6bf54eb
commit 864008ea6b
  1. 4
      transport/grpc/client.go
  2. 8
      transport/grpc/server.go

@ -5,7 +5,6 @@ import (
"time"
"github.com/go-kratos/kratos/v2/middleware"
"github.com/go-kratos/kratos/v2/middleware/recovery"
"github.com/go-kratos/kratos/v2/registry"
"github.com/go-kratos/kratos/v2/transport"
"github.com/go-kratos/kratos/v2/transport/grpc/resolver/discovery"
@ -85,9 +84,6 @@ func DialInsecure(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn,
func dial(ctx context.Context, insecure bool, opts ...ClientOption) (*grpc.ClientConn, error) {
options := clientOptions{
timeout: 500 * time.Millisecond,
middleware: middleware.Chain(
recovery.Recovery(),
),
}
for _, o := range opts {
o(&options)

@ -12,7 +12,6 @@ import (
"github.com/go-kratos/kratos/v2/internal/host"
"github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/middleware"
"github.com/go-kratos/kratos/v2/middleware/recovery"
"github.com/go-kratos/kratos/v2/transport"
"google.golang.org/grpc"
"google.golang.org/grpc/health"
@ -100,11 +99,8 @@ func NewServer(opts ...ServerOption) *Server {
network: "tcp",
address: ":0",
timeout: 1 * time.Second,
middleware: middleware.Chain(
recovery.Recovery(),
),
health: health.NewServer(),
log: log.NewHelper(log.DefaultLogger),
health: health.NewServer(),
log: log.NewHelper(log.DefaultLogger),
}
for _, o := range opts {
o(srv)

Loading…
Cancel
Save