spring boot
程序员大佬
这个作者很懒,什么都没留下…
展开
-
Spring Boot 定时任务单线程和多线程
Spring Boot 的定时任务: 第一种:把参数配置到.properties文件中: 代码: package com.accord.task; import java.text.SimpleDateFormat; import java.util.Date; import org.springframework.scheduling.annotation.Scheduled; import o...转载 2019-05-07 10:21:43 · 248 阅读 · 0 评论 -
spring scheduled单线程和多线程使用过程中的大坑!!不看到时候绝对后悔!!
公司在使用定时任务的时候,使用的是spring Scheduled。 代码如下: @EnableScheduling public class TaskFileScheduleService { @Scheduled(cron="0 */1 * * * ?") public void task1(){ ....... } @Scheduled(...原创 2019-05-13 09:58:47 · 16893 阅读 · 10 评论