From df35513a888cd03f2a3e2eacdf9f1d9dc1f0c135 Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Thu, 22 Jan 2026 09:41:06 +0800
Subject: [PATCH] 1. 修改航点编号名称。
---
ard-framework/src/main/java/com/ard/framework/config/ThreadPoolConfig.java | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/ard-framework/src/main/java/com/ard/framework/config/ThreadPoolConfig.java b/ard-framework/src/main/java/com/ard/framework/config/ThreadPoolConfig.java
index 9aebc15..76c3a93 100644
--- a/ard-framework/src/main/java/com/ard/framework/config/ThreadPoolConfig.java
+++ b/ard-framework/src/main/java/com/ard/framework/config/ThreadPoolConfig.java
@@ -4,6 +4,7 @@
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
@@ -12,7 +13,7 @@
/**
* 线程池配置
*
- * @author ruoyi
+ * @author ard
**/
@Configuration
public class ThreadPoolConfig
@@ -30,6 +31,7 @@
private int keepAliveSeconds = 300;
@Bean(name = "threadPoolTaskExecutor")
+ @Primary
public ThreadPoolTaskExecutor threadPoolTaskExecutor()
{
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
@@ -60,4 +62,32 @@
}
};
}
+ @Bean("mediaVideoExecutor")
+ public ThreadPoolTaskExecutor mediaVideoExecutor() {
+ ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+ executor.setCorePoolSize(10); // 核心线程数:同时处理视频的核心线程数
+ executor.setMaxPoolSize(10); // 最大线程数:线程池不会扩展超过这个数量
+ executor.setQueueCapacity(50); // 队列容量:等待执行的任务数量,之前20太小可能会拒绝任务
+ executor.setThreadNamePrefix("media-video-");
+
+ // 当线程池和队列都满时的拒绝策略
+ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+
+ executor.initialize();
+ return executor;
+ }
+ @Bean("mediaPicExecutor")
+ public ThreadPoolTaskExecutor mediaPicExecutor() {
+ ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+ executor.setCorePoolSize(10); // 核心线程数:同时处理视频的核心线程数
+ executor.setMaxPoolSize(10); // 最大线程数:线程池不会扩展超过这个数量
+ executor.setQueueCapacity(50); // 队列容量:等待执行的任务数量,之前20太小可能会拒绝任务
+ executor.setThreadNamePrefix("media-pic-");
+
+ // 当线程池和队列都满时的拒绝策略
+ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+
+ executor.initialize();
+ return executor;
+ }
}
--
Gitblit v1.9.3