From 30454276e6c1b4ca641c762bd34c59135d98fe98 Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Mon, 18 Jan 2021 19:22:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=B0docker=E5=A4=96?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dipperposition/handler/NettyServerHandler.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java b/src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java index 86868d7..f82c58b 100644 --- a/src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java +++ b/src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java @@ -6,6 +6,9 @@ import com.telpo.dipperposition.enums.DipperReturnValue; import com.telpo.dipperposition.service.IDipperAstPosAsyncTaskService; import com.telpo.dipperposition.service.IDipperAstTimeAsyncTaskService; import com.telpo.dipperposition.service.IDipperDataAsyncTaskService; +import com.telpo.dipperposition.service.impl.DipperAstPosAsyncTaskServiceImpl; +import com.telpo.dipperposition.service.impl.DipperAstTimeAsyncTaskServiceImpl; +import com.telpo.dipperposition.service.impl.DipperDataAsyncTaskServiceImpl; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.socket.SocketChannel; @@ -110,6 +113,9 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { //if (AST_TIME_CMD.equals(recvmg)) { if (AST_TIME_CMD.equals(msg)) { // 初始时间辅助输入; + if (dipperTimeAsyncTaskService == null) { + dipperTimeAsyncTaskService = new DipperAstTimeAsyncTaskServiceImpl(); + } channelAns = dipperTimeAsyncTaskService.pushAstTime(); } @@ -123,6 +129,9 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { // positionConfig.getCenterProvince(), // positionConfig.getIpPositionRequestPath(), // positionConfig.getIpPositionRequestKey()); + if (dipperAstPosAsyncTaskService == null) { + dipperAstPosAsyncTaskService = new DipperAstPosAsyncTaskServiceImpl(); + } channelAns = dipperAstPosAsyncTaskService.pushAstPos(ipAddress, "/csv/provinceLonAlt.csv", "湖北省", @@ -134,6 +143,9 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { //if (Integer.parseInt(starsAsycServerPort) == channel.localAddress().getPort()) { //if (AST_POS_CMD.equals(recvmg)) { if (AST_POS_CMD.equals(msg)) { + if (dipperDataAsyncTaskService == null) { + dipperDataAsyncTaskService = new DipperDataAsyncTaskServiceImpl(); + } channelAns = dipperDataAsyncTaskService.getAstEPH(); }