Helius
2020-07-02 cbf27426370f1fc9c8ae27b717c8d1f175ea358e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.xcong.excoin.quartz.job;
 
import com.xcong.excoin.modules.coin.service.BlockCoinService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
 
/**
 * 链上币种同步任务
 *
 * @author wzy
 * @date 2020-07-02
 **/
@Component
@ConditionalOnProperty(prefix = "app", name = "block-job", havingValue = "true")
public class BlockCoinUpdateJob {
 
    @Resource
    private BlockCoinService blockCoinService;
 
 
    /**
     * ETH_USDT 同步
     */
    @Scheduled(cron = "0 0/10 * * * ? ")
    public void ethUsdtUpdate() {
        blockCoinService.updateEthUsdt();
    }
 
    /**
     * eth 同步
     */
    @Scheduled(cron = "0 1/20 * * * ? ")
    public void ethUpdate() {
        blockCoinService.updateEth();
    }
 
}