From dbe2589c99ae37beefa66a3149d5de96cde9ad48 Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Sat, 6 Feb 2021 06:47:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=8D=E8=AF=95=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DipperDataAsyncTaskServiceImpl.java | 13 ++++++------- src/main/resources/bootstrap-test.yaml | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/telpo/dipperposition/service/impl/DipperDataAsyncTaskServiceImpl.java b/src/main/java/com/telpo/dipperposition/service/impl/DipperDataAsyncTaskServiceImpl.java index e955650..b073e78 100644 --- a/src/main/java/com/telpo/dipperposition/service/impl/DipperDataAsyncTaskServiceImpl.java +++ b/src/main/java/com/telpo/dipperposition/service/impl/DipperDataAsyncTaskServiceImpl.java @@ -34,19 +34,18 @@ public class DipperDataAsyncTaskServiceImpl implements IDipperDataAsyncTaskServi @Override @Async("asyncServiceExecutor") public void pullAstEPH(int tryTimes) throws InterruptedException { - if (tryTimes==0) { - return; - } else { - tryTimes--; - } + tryTimes--; // (1) 发送bds获取星历数据 byte[] dipperData = pullEPHFromDipper(); // (2) 获取星历数据 if (dipperData == null) { log.error("获取星历数据错误,取不到星历数据。"); - sleep(10000); - pullAstEPH(tryTimes); + if (tryTimes>0) { + log.info("等待10秒再获取1次。"); + sleep(10000); + pullAstEPH(tryTimes); + } } else { // 保存到DB或者缓存 log.info("保存到DB或者缓存"); diff --git a/src/main/resources/bootstrap-test.yaml b/src/main/resources/bootstrap-test.yaml index 60cd53e..22f9b81 100644 --- a/src/main/resources/bootstrap-test.yaml +++ b/src/main/resources/bootstrap-test.yaml @@ -63,7 +63,7 @@ pos: centerProvince: 湖北省 astServer: agnss.techtotop.com astPosAstPort: 8012 - astEphAstHexPort: 9012 + astEphAstHexPort: 9112 astTimeout: 30000 position-server: