mirror of
https://github.com/luoye663/e5.git
synced 2024-12-25 11:18:50 +00:00
移除webflux依赖
更改调用模式为线程池,取消rabbitMQ队列使用
This commit is contained in:
parent
3cc4b0992f
commit
531a725592
@ -14,7 +14,6 @@ import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
@ -37,9 +36,16 @@ public class Start {
|
||||
IOutlookService outlookService;
|
||||
|
||||
@Value("${e5.system.threadPool}")
|
||||
private int poolSize = 10;
|
||||
Integer poolSize;
|
||||
|
||||
private ExecutorService threadPool = new ThreadPoolExecutor(
|
||||
private ExecutorService threadPool;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
log.info("清空redis...... ");
|
||||
redisUtil.delAll();
|
||||
threadPool = new ThreadPoolExecutor(
|
||||
//指定了线程池中的线程数量,它的数量决定了添加的任务是开辟新的线程去执行,还是放到workQueue任务队列中去;
|
||||
poolSize,
|
||||
//指定了线程池中的最大线程数量,这个参数会根据你使用的workQueue任务队列的类型,决定线程池会开辟的最大线程数量;
|
||||
@ -56,16 +62,9 @@ public class Start {
|
||||
new CustRejectedExecutionHandler()
|
||||
);
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
log.info("清空redis...... ");
|
||||
redisUtil.delAll();
|
||||
/* log.info("重新添加队列...... ");
|
||||
Task.sendTaskOutlookMQALL();*/
|
||||
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0/10 * * * * ?")
|
||||
@Scheduled(cron = "0 0/1 * * * ? ")
|
||||
private void distributeTask() {
|
||||
List<Outlook> runOutlookList = outlookService.findRunOutlookList();
|
||||
CountDownLatch cdl = new CountDownLatch(runOutlookList.size());
|
||||
|
Loading…
Reference in New Issue
Block a user