package cn.huge.module.timer;
|
|
import cn.huge.module.griddata.service.GridDataSyncService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
import javax.annotation.Resource;
|
|
/**
|
*
|
*/
|
@Slf4j
|
@Component
|
public class scheduledTask {
|
|
@Resource
|
private GridDataSyncService gridDataSyncService;
|
//周一到周六,UTC时间0点-12点,每2小时执行一次(对应北京时间8点-20点)
|
@Scheduled(cron = "0 0/30 0-12 * * 1-6")
|
public void syncData(){
|
log.info("开始同步数据");
|
gridDataSyncService.syncData();
|
}
|
|
|
}
|