()
| 25 | |
| 26 | //cms.web.action.quartz.Task.java类topicIndex()方法@Async("taskExecutor_topicIndex")调用 |
| 27 | @Bean |
| 28 | public Executor taskExecutor() { |
| 29 | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); |
| 30 | executor.setCorePoolSize(corePoolSize);//核心线程池大小 |
| 31 | executor.setMaxPoolSize(maxPoolSize);//最大线程数 |
| 32 | //线程池对拒绝任务(无线程可用)的处理策略 |
| 33 | executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());//处理的方法是运行计算任务,除非ThreadPoolExecutor被关闭,这样的话,任务会被丢弃 |
| 34 | |
| 35 | executor.initialize(); |
| 36 | return executor; |
| 37 | } |
| 38 | |
| 39 | |
| 40 |
nothing calls this directly
no outgoing calls
no test coverage detected