From 0d2901bdbed7d3ff2dc8975b78b83a14e96da2a0 Mon Sep 17 00:00:00 2001 From: ehlxr Date: Sat, 23 Jan 2021 19:46:00 +0800 Subject: [PATCH] config deploy to github --- .../src/main/java/io/github/ehlxr/did/ServerStarter.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/did-server/src/main/java/io/github/ehlxr/did/ServerStarter.java b/did-server/src/main/java/io/github/ehlxr/did/ServerStarter.java index 1582f9f..1083497 100644 --- a/did-server/src/main/java/io/github/ehlxr/did/ServerStarter.java +++ b/did-server/src/main/java/io/github/ehlxr/did/ServerStarter.java @@ -41,8 +41,11 @@ public class ServerStarter { sdkServer.init(); sdkServer.start(); - // 并行 shutdown server Runtime.getRuntime().addShutdownHook(new Thread(() -> - Arrays.stream(new Server[]{httpServer, sdkServer}).parallel().forEach(Server::shutdown))); + Arrays.stream(new Server[]{httpServer, sdkServer}) + // 并行 shutdown server + .parallel() + .forEach(Server::shutdown)) + ); } }