refactor(tik): 移除 ICE 异步提交专用线程池定义
Some checks failed
Build and Deploy / deploy (push) Has been cancelled
Some checks failed
Build and Deploy / deploy (push) Has been cancelled
将线程池定义移至 `TikAsyncConfig` 配置类中统一管理,清理 `MixTaskConfig` 中冗余的 `iceSubmitExecutor` Bean 定义,提升配置职责的清晰度。
This commit is contained in:
@@ -2,14 +2,10 @@ package cn.iocoder.yudao.module.tik.mix.config;
|
|||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
import java.security.Security;
|
import java.security.Security;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 混剪任务配置
|
* 混剪任务配置
|
||||||
@@ -21,27 +17,14 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
public class MixTaskConfig {
|
public class MixTaskConfig {
|
||||||
|
|
||||||
/**
|
|
||||||
* ICE 异步提交专用线程池
|
|
||||||
* <p>
|
|
||||||
* 核心线程 4,最大线程 10,空闲 60s 回收,有界队列 200,
|
|
||||||
* 拒绝策略:调用者线程执行(CallerRunsPolicy),确保任务不丢失
|
|
||||||
*/
|
|
||||||
@Bean("iceSubmitExecutor")
|
|
||||||
public ThreadPoolExecutor iceSubmitExecutor() {
|
|
||||||
return new ThreadPoolExecutor(
|
|
||||||
4, 10,
|
|
||||||
60, TimeUnit.SECONDS,
|
|
||||||
new LinkedBlockingQueue<>(200),
|
|
||||||
new ThreadPoolExecutor.CallerRunsPolicy()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册 BouncyCastle 安全提供者
|
* 注册 BouncyCastle 安全提供者
|
||||||
* <p>
|
* <p>
|
||||||
* ICE SDK 底层依赖 BC 做 API 请求签名({@code org.bouncycastle.crypto.Digest})。
|
* ICE SDK 底层依赖 BC 做 API 请求签名({@code org.bouncycastle.crypto.Digest})。
|
||||||
* Java 17 已内置 JCE,不再存在嵌套 JAR 签名校验失败的问题,直接注册即可。
|
* Java 17 已内置 JCE,不再存在嵌套 JAR 签名校验失败的问题。
|
||||||
|
* <p>
|
||||||
|
* 注意:ICE 提交专用线程池 {@code iceSubmitExecutor} 定义在
|
||||||
|
* {@link cn.iocoder.yudao.module.tik.config.TikAsyncConfig} 中。
|
||||||
*/
|
*/
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user