File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
grpc-spring-boot-starter/src/main/java/org/lognet/springboot/grpc Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -149,10 +149,14 @@ private void startDaemonAwaitThread() {
149149
150150 @ Override
151151 public void destroy () throws Exception {
152- log .info ("Shutting down gRPC server ..." );
153- server .getServices ().forEach (def ->healthStatusManager .clearStatus (def .getServiceDescriptor ().getName ()));
154- Optional .ofNullable (server ).ifPresent (Server ::shutdown );
155- log .info ("gRPC server stopped." );
152+
153+ Optional .ofNullable (server ).ifPresent (s ->{
154+ log .info ("Shutting down gRPC server ..." );
155+ s .getServices ().forEach (def ->healthStatusManager .clearStatus (def .getServiceDescriptor ().getName ()));
156+ s .shutdown ();
157+ log .info ("gRPC server stopped." );
158+ });
159+
156160 }
157161
158162 private <T > Stream <String > getBeanNamesByTypeWithAnnotation (Class <? extends Annotation > annotationType , Class <T > beanType ) throws Exception {
You can’t perform that action at this time.
0 commit comments