Pārlūkot izejas kodu

增加重试逻辑

tags/v1.0.0^2
林万龙 pirms 3 gadiem
vecāks
revīzija
dbe2589c99
2 mainītis faili ar 7 papildinājumiem un 8 dzēšanām
  1. +6
    -7
      src/main/java/com/telpo/dipperposition/service/impl/DipperDataAsyncTaskServiceImpl.java
  2. +1
    -1
      src/main/resources/bootstrap-test.yaml

+ 6
- 7
src/main/java/com/telpo/dipperposition/service/impl/DipperDataAsyncTaskServiceImpl.java Parādīt failu

@@ -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或者缓存");


+ 1
- 1
src/main/resources/bootstrap-test.yaml Parādīt failu

@@ -63,7 +63,7 @@ pos:
centerProvince: 湖北省
astServer: agnss.techtotop.com
astPosAstPort: 8012
astEphAstHexPort: 9012
astEphAstHexPort: 9112
astTimeout: 30000

position-server:


Notiek ielāde…
Atcelt
Saglabāt