Helius
2021-04-14 f3948fa31158c7b7dea3b038e01c43ce54c55a1c
src/main/java/com/xcong/excoin/quartz/job/BlockCoinUpdateJob.java
@@ -1,11 +1,19 @@
package com.xcong.excoin.quartz.job;
import com.xcong.excoin.common.enumerates.CoinTypeEnum;
import com.xcong.excoin.modules.blackchain.service.TrxUsdtUpdateService;
import com.xcong.excoin.modules.coin.service.BlockCoinService;
import com.xcong.excoin.modules.member.dao.MemberCoinAddressDao;
import com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity;
import com.xcong.excoin.utils.RedisUtils;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
 * 链上币种同步任务
@@ -20,11 +28,27 @@
    @Resource
    private BlockCoinService blockCoinService;
    @Resource
    private TrxUsdtUpdateService trxUsdtUpdateService;
    @Resource
    RedisUtils redisUtils;
    /**
     * ETH_USDT 同步
     * TRC20_USDT 同步
     */
    @Scheduled(cron = "0 0/10 * * * ? ")
    @Scheduled(cron = "0/3 * * * * ? ")
    @Async
    public void usdtTc20Update() {
        // 波场3秒出一个块
        trxUsdtUpdateService.monitorCoinListener();
    }
    /**
     * ETH_USDT 同步 使用扫块 废弃这个定时任务
     */
    //@Scheduled(cron = "0 0/10 * * * ? ")
    @Deprecated
    public void ethUsdtUpdate() {
        blockCoinService.updateEthUsdt();
    }
@@ -32,7 +56,7 @@
    /**
     * eth 同步
     */
    @Scheduled(cron = "0 1/20 * * * ? ")
//    @Scheduled(cron = "0 1/20 * * * ? ")
    public void ethUpdate() {
        blockCoinService.updateEth();
    }
@@ -45,17 +69,17 @@
        blockCoinService.updateBtcUsdt();
    }
//    @Scheduled(cron = "0 3/20 * * * ? ")
    //    @Scheduled(cron = "0 3/20 * * * ? ")
    public void btcUpdate() {
        blockCoinService.updateBtc();
    }
//    @Scheduled(cron = "0 4/20 * * * ? ")
    //    @Scheduled(cron = "0 4/20 * * * ? ")
    public void eosUpdate() {
        blockCoinService.updateEos();
    }
//    @Scheduled(cron = "0 6/20 * * * ? ")
    //    @Scheduled(cron = "0 6/20 * * * ? ")
    public void xrpUpdate() {
        blockCoinService.updateXrp();
    }