2018年11月29日

SpringBoot定时任务

摘要: 1、在启动类上写@EnableScheduling注解 2、在要定时任务的类上写@component 3、在要定时执行的方法上写@Scheduled(cron = "0 0/5 * * * ?")。 cron表达式:* 第一位,表示秒,取值0-59* 第二位,表示分,取值0-59* 第三位,表示小时 阅读全文

posted @ 2018-11-29 21:04 lina2014 阅读(98) 评论(0) 推荐(0) 编辑

导航