package cc.mrbird.febs.mall.chain.job; import cc.mrbird.febs.common.utils.RedisUtils; import cc.mrbird.febs.mall.chain.constants.ChainConstants; import cc.mrbird.febs.mall.chain.service.TrxUsdtUpdateService; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.Set; /** * 归集定时任务 * * @author wzy * @date 2020-07-02 **/ @Slf4j @Component @ConditionalOnProperty(prefix = "system", name = "block-job", havingValue = "true") public class NotionalPoolingJob { @Resource private RedisUtils redisUtils; @Resource private TrxUsdtUpdateService trxUsdtUpdateService; // /** // * usdt 归集 // */ // @Scheduled(cron = "0 5/30 * * * ? ") // public void poolUsdtEth() { // try { // log.info("USDT归集开始"); // usdtEthService.pool(); // log.info("USDT归集结束"); // } catch (ExecutionException | InterruptedException e) { // log.error("#usdt归集错误#", e); // } // } // // /** // * 使用扫块 不需要这个 // */ // //@Scheduled(cron = "0 2/8 * * * ? ") // @Deprecated // public void usdtEthPoolCheck() { // log.info("USDTETH归集结果扫描开始"); // usdtEthService.usdtEthPoolCheck(); // } // // @Scheduled(cron = "0 2/30 * * * ? ") // public void poolEth() { // try { // usdtEthService.ethPool(); // } catch (ExecutionException | InterruptedException e) { // log.info("#ETH归集错误#", e); // } // } /** * 归集TRC20 */ @Scheduled(cron = "0 0/30 * * * ? ") public void poolUsdtTrc20() { // TODO 执行BSC归集逻辑 log.info("归集TRC20执行"); // Set poolAddress = redisUtils.sGet(ChainConstants.REDIS_KEY_POOL_ADDRESS); // if (poolAddress == null || poolAddress.isEmpty()) { // return; // } // // for (Object address : poolAddress) { // String next = (String) address; // log.info("归集地址:{}", next); // trxUsdtUpdateService.poolByAddress(next); // } } }