lvzhiqiang 1 жил өмнө
parent
commit
56c1d4dd1d

+ 5 - 3
src/main/java/top/lvzhiqiang/service/impl/CoinServiceImpl.java

@@ -848,10 +848,12 @@ public class CoinServiceImpl implements CoinService {
         }, 0, 5, TimeUnit.SECONDS);
 
         // coingecko
-        scheduler.scheduleAtFixedRate(() -> {
+        scheduler.scheduleWithFixedDelay(() -> {
             if (!"1".equals(getMonitorJobStatus("watchlist-coingecko-cmc"))) {
+                log.warn("watchlist-coingecko-cmc scheduler return");
                 return;
             }
+            log.warn("watchlist-coingecko-cmc scheduler start");
 
             int MAX_NUMBER = 100;
             Map<String, Object> params = new HashMap<>();
@@ -864,7 +866,6 @@ public class CoinServiceImpl implements CoinService {
                         try {
                             Thread.sleep(5000L);
                         } catch (InterruptedException e) {
-                            throw new RuntimeException(e);
                         }
 
                         Map<String, CoinWatchlist> coinWatchlistMap4CoingeckoId = watchlistListCKO.stream().skip((long) i * MAX_NUMBER).limit(MAX_NUMBER).collect(Collectors.toMap(CoinWatchlist::getCoingeckoId, coinWatchlist -> coinWatchlist));
@@ -876,12 +877,13 @@ public class CoinServiceImpl implements CoinService {
                         try {
                             Thread.sleep(5000L);
                         } catch (InterruptedException e) {
-                            throw new RuntimeException(e);
                         }
 
                         Map<Long, CoinWatchlist> coinWatchlistMap4CmcId = watchlistListCMC.stream().skip((long) i * MAX_NUMBER).limit(MAX_NUMBER).collect(Collectors.toMap(CoinWatchlist::getCmcId, coinWatchlist -> coinWatchlist));
                         parseWatchlistMap4CmC(coinWatchlistMap4CmcId);
                     });
+
+            log.warn("watchlist-coingecko-cmc scheduler end");
         }, 0, 1, TimeUnit.HOURS);
 
         // Upbit交易所监控报警