This commit is contained in:
Kevin Wan
2021-08-04 18:45:05 +08:00
committed by GitHub
parent 16cc990fdd
commit 0ee7654407
5 changed files with 80 additions and 1 deletions

View File

@@ -58,10 +58,12 @@ func (s *rpcServer) Start(register RegisterFn) error {
serverinterceptors.UnaryCrashInterceptor(),
serverinterceptors.UnaryStatInterceptor(s.metrics),
serverinterceptors.UnaryPrometheusInterceptor(),
serverinterceptors.UnaryBreakerInterceptor(),
}
unaryInterceptors = append(unaryInterceptors, s.unaryInterceptors...)
streamInterceptors := []grpc.StreamServerInterceptor{
serverinterceptors.StreamCrashInterceptor,
serverinterceptors.StreamBreakerInterceptor,
}
streamInterceptors = append(streamInterceptors, s.streamInterceptors...)
options := append(s.options, WithUnaryServerInterceptors(unaryInterceptors...),