Springboot解决使用@Scheduled创建任务时无法在同一时间执行多个任务的BUG
2024-08-23 16:13:45
1、在启动类使用
@SpringBootApplication
@EnableJpaRepositories(repositoryFactoryBeanClass = MyRepositoryFactoryBean.class)
@EnableTransactionManagement
@EnableAutoConfiguration
//@EnableAutoConfiguration(exclude = {org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class})
@EnableScheduling
@Configuration
@EnableDiscoveryClient
@EnableFeignClients
@EnableCaching
public class Application extends DefaultApplication { /**
*
*〈简述〉修复同一时间无法执行多个 定时任务问题
*〈详细描述〉
* @author miaoShijun
* @return
*/
@Bean
public TaskScheduler taskScheduler() {
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.setPoolSize(50);
return taskScheduler;
} /**
* 〈简述〉应用启动入口
* 〈详细描述〉
*
* @param args String[] 参数
* @author miaoShijun
*/
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
} }
最新文章
- 解决httpd: Could not reliably determine the server's fully qualified domain name
- tableViewCell嵌套collectionView,动态高度
- WinForm DataGridView分页功能
- Ember.js实现单页面应用程序
- android-xxxx must implement the inherited abstract method报错
- 在ubuntu上搭建开发环境6---安装和使用vim及其插件(Pathogen和NERDTree)
- dotfiles管理
- Mix and Build(简单DP)
- iOS终端查看.a文件是否能在模拟器上运行
- plsql programming 17 过程, 函数与参数
- JavaScript之Object
- XSS 复合编码 续
- Android,使用Intent或Bundle传递参数,跳转页面。
- 浅谈 js 正则字面量 与 new RegExp 执行效率
- js 计算过去和未来的时间距离现在多少天?
- 从minist database(t10k-images-idx3-ubyte)中读取图片
- php+ajax的三级联动下拉菜单
- [luogu P2633] Count on a tree
- Java基础之Java 修饰符
- <;a>;标签中的href如何调用js代码
热门文章
- kali网络源配置
- 【leetcode】714. Best Time to Buy and Sell Stock with Transaction Fee
- httpClient连接工具类实测可用
- MySQL执行计划之EXPLAIN基本解释说明
- 【2019 Multi-University Training Contest 4】
- SSH弱小算法支持问题
- Toposort(拓扑排序)dfs递归模板
- linux从head.s到start_kernelstart_kernel之---内核重定位后分析
- 113、TensorFlow变量集合
- git使用记录九:开发中临时加塞了紧急任务怎么处理