定时任务定时刷新
@Component
@Configuration
@EnableScheduling
public class TimedTask {
@Autowired
private IndexOverViewService indexOverViewService;
/**
* 每天凌晨刷新
*/
@ApiOperation("刷新")
@Scheduled(cron = "0 0 0 * * ?")//cron在线生成器 https://cron.qqe2.com
public void refreshIndicators(){
//定时器执行的内容
indexOverViewService.refreshIndicators();
}
}