Skip to content

Commit 0840111

Browse files
easyCZroboquat
authored andcommitted
[baseserver] Use common interceptors
1 parent ff6c381 commit 0840111

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

components/common-go/baseserver/server.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,20 +238,16 @@ func (s *Server) newHTTPMux() *http.ServeMux {
238238
}
239239

240240
func (s *Server) initializeGRPC() error {
241-
var opts []grpc.ServerOption
242-
243241
gitpod_grpc.SetupLogging()
244242

245-
unary := grpc.ChainUnaryInterceptor(
243+
unary := []grpc.UnaryServerInterceptor{
246244
grpc_logrus.UnaryServerInterceptor(s.Logger()),
247-
)
248-
stream := grpc.ChainStreamInterceptor(
245+
}
246+
stream := []grpc.StreamServerInterceptor{
249247
grpc_logrus.StreamServerInterceptor(s.Logger()),
250-
)
251-
252-
opts = append(opts, unary, stream)
248+
}
253249

254-
s.grpc = grpc.NewServer(opts...)
250+
s.grpc = grpc.NewServer(gitpod_grpc.ServerOptionsWithInterceptors(stream, unary)...)
255251

256252
return nil
257253
}

0 commit comments

Comments
 (0)