diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/NettyServerSocketHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/NettyServerSocketHandler.java index 3b243156..f2f5d5f3 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/NettyServerSocketHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/NettyServerSocketHandler.java @@ -139,7 +139,6 @@ public void run() { public void initChannel(NioSocketChannel ch) { ChannelPipeline pipeline = ch.pipeline(); //p.addLast(new LoggingHandler(LogLevel.INFO)); - System.out.println("P!"); pipeline.addLast(new HttpServerCodec()); pipeline.addLast(new HttpObjectAggregator(65536)); pipeline.addLast(new WebSocketServerCompressionHandler()); diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/LegacyRequestBridge.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/LegacyRequestBridge.java index 73e89432..0fe13dec 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/LegacyRequestBridge.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/LegacyRequestBridge.java @@ -5,6 +5,7 @@ import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launcher.request.RequestException; import ru.gravit.launcher.request.ResultInterface; +import ru.gravit.utils.helper.JVMHelper; import ru.gravit.utils.helper.LogHelper; import java.io.IOException; @@ -44,6 +45,13 @@ public static void initWebSockets(String address) { } catch (InterruptedException e) { e.printStackTrace(); } + JVMHelper.RUNTIME.addShutdownHook(new Thread(() -> { + try { + service.closeBlocking(); + } catch (InterruptedException e) { + LogHelper.error(e); + } + })); } static {