多线程线程数参数配置提取到环境变量配置文件

topo_dev
DESKTOP-DDTUS3E\yaxin 6 months ago
parent 054098568c
commit 5549435aee

@ -21,6 +21,8 @@ SPRING_PROFILES_ACTIVE=prod
OLLAMA_URL=http://192.168.10.70:11434
OLLAMA_MODEL=llama3-chinese:8b
LANGCHAIN_CHAT_URL=http://113.128.242.110:7861
THREAD_POOL_TRIPLE_CORE=1
THREAD_POOL_TYPE_CORE=1
# nginx相关配置内容

@ -27,6 +27,8 @@ services:
--neo4j.password=${NEO4J_PASSWORD}
--minio.username=${MINIO_USER}
--minio.password=${MINIO_PASSWORD}
--fu-hsi-config.thread-pool.triple.core=${THREAD_POOL_TRIPLE_CORE}
--fu-hsi-config.thread-pool.type.core=${THREAD_POOL_TYPE_CORE}
environment:
- TZ=${TIMEZONE}
networks:

@ -1,13 +1,25 @@
package com.supervision.thread;
import cn.hutool.core.thread.ThreadUtil;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import java.util.concurrent.ExecutorService;
/**
* 线
*/
@Slf4j
public class RecordSplitTypeThreadPool {
@Value("${fu-hsi-config.thread-pool.type.core:2}")
private int core;
public static final ExecutorService recordSplitTypeExecutor = ThreadUtil.newFixedExecutor(5, Integer.MAX_VALUE, "recordSplitType", false);
public static ExecutorService recordSplitTypeExecutor;
@PostConstruct
public void init() {
log.info("RecordSplitType线程池初始化。线程数{}", core);
recordSplitTypeExecutor = ThreadUtil.newFixedExecutor(core, Integer.MAX_VALUE, "recordSplitType", false);
}
}

@ -1,10 +1,22 @@
package com.supervision.thread;
import cn.hutool.core.thread.ThreadUtil;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import java.util.concurrent.ExecutorService;
@Slf4j
public class TripleExtractThreadPool {
@Value("${fu-hsi-config.thread-pool.triple.core:2}")
private int core;
public static final ExecutorService chatExecutor = ThreadUtil.newFixedExecutor(5, Integer.MAX_VALUE, "tripleExtract", false);
public static ExecutorService chatExecutor;
@PostConstruct
public void init() {
log.info("tripleExtract线程池初始化。线程数{}", core);
chatExecutor = ThreadUtil.newFixedExecutor(core, Integer.MAX_VALUE, "tripleExtract", false);
}
}

@ -25,3 +25,9 @@ server:
case:
evidence:
table: case_evidence
fu-hsi-config:
thread-pool:
triple:
core: 2
type:
core: 2
Loading…
Cancel
Save