| | |
| | | package com.xcong.excoin.quartz.job; |
| | | |
| | | import com.xcong.excoin.modules.blackchain.service.UsdtEthService; |
| | | 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.concurrent.ExecutionException; |
| | | |
| | | /** |
| | | * 归集定时任务 |
| | |
| | | * @date 2020-07-02 |
| | | **/ |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @ConditionalOnProperty(prefix = "app", name = "block-job", havingValue = "true") |
| | | public class NotionalPoolingJob { |
| | | |
| | | @Resource |
| | | private UsdtEthService usdtEthService; |
| | | |
| | | /** |
| | | * 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 * * * ? ") |
| | | 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); |
| | | } |
| | | } |
| | | } |