🔨 线程池配置化.

This commit is contained in:
lijiahangmax
2025-10-07 00:28:49 +08:00
parent cb20d56a7b
commit 25082b9ea1
31 changed files with 720 additions and 287 deletions

View File

@@ -88,6 +88,10 @@
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-job</artifactId>
</dependency>
<dependency>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-executor</artifactId>
</dependency>
<dependency>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-test</artifactId>
@@ -102,4 +106,4 @@
</dependency>
</dependencies>
</project>
</project>

View File

@@ -22,12 +22,9 @@
*/
package org.dromara.visor.module.asset.define;
import cn.orionsec.kit.lang.define.thread.ExecutorBuilder;
import cn.orionsec.kit.lang.utils.Systems;
import org.dromara.visor.common.constant.Const;
import org.dromara.visor.framework.executor.core.utils.ExecutorUtils;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.Executor;
/**
* 执行线程池
@@ -41,13 +38,6 @@ public interface AssetThreadPools {
/**
* 批量执行主机命令线程池
*/
ThreadPoolExecutor AGENT_INSTALL = ExecutorBuilder.create()
.namedThreadFactory("agent-install-")
.corePoolSize(Systems.PROCESS_NUM)
.maxPoolSize(Systems.PROCESS_NUM)
.keepAliveTime(Const.MS_S_60)
.workQueue(new LinkedBlockingQueue<>())
.allowCoreThreadTimeout(true)
.build();
Executor AGENT_INSTALL = ExecutorUtils.getExecutor("agentInstallExecutor");
}