| | |
| | | package cc.mrbird.febs.job; |
| | | |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.dapp.chain.ChainConstants; |
| | | import cc.mrbird.febs.dapp.chain.TrxUsdtUpdateService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.concurrent.ExecutionException; |
| | | |
| | | /** |
| | |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @ConditionalOnProperty(prefix = "app", name = "block-job", havingValue = "true") |
| | | @ConditionalOnProperty(prefix = "system", name = "block-job", havingValue = "true") |
| | | public class NotionalPoolingJob { |
| | | // |
| | | // @Resource |
| | |
| | | // } |
| | | |
| | | /** |
| | | * 归集TRC20 |
| | | * 归集TRC20 |
| | | */ |
| | | @Scheduled(cron = "0 1/5 * * * ? ") |
| | | @Scheduled(cron = "0 0/30 * * * ? ") |
| | | public void poolUsdtTrc20() { |
| | | log.info("归集TRC20执行"); |
| | | Object trc20_pool = redisUtils.get("TRC20_POOL"); |
| | | if(trc20_pool==null){ |
| | | Set<Object> poolAddress = redisUtils.sGet(ChainConstants.REDIS_KEY_POOL_ADDRESS); |
| | | if (poolAddress == null || poolAddress.isEmpty()) { |
| | | return; |
| | | } |
| | | List<String> list = (List)trc20_pool; |
| | | for(String address: list){ |
| | | trxUsdtUpdateService.poolByAddress(address); |
| | | |
| | | for (Object address : poolAddress) { |
| | | String next = (String) address; |
| | | log.info("归集地址:{}", next); |
| | | trxUsdtUpdateService.poolByAddress(next); |
| | | } |
| | | } |
| | | } |