llm 동작 수정

This commit is contained in:
Macbook
2026-06-17 15:37:23 +09:00
parent 301f45301f
commit edac7540cd
14 changed files with 901 additions and 63 deletions
@@ -0,0 +1,30 @@
package com.goldenchart.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
/**
* 전략평가 AI 검증 — LLM·Ta4j 재평가를 HTTP 요청 스레드와 분리.
*/
@Configuration
public class AiVerifyAsyncConfig {
@Bean(name = "aiVerifyExecutor")
public Executor aiVerifyExecutor(
@Value("${goldenchart.llm.ai-verify.pool-size:2}") int poolSize,
@Value("${goldenchart.llm.ai-verify.queue-capacity:8}") int queueCapacity) {
ThreadPoolTaskExecutor ex = new ThreadPoolTaskExecutor();
ex.setThreadNamePrefix("ai-verify-");
ex.setCorePoolSize(Math.max(1, poolSize));
ex.setMaxPoolSize(Math.max(1, poolSize));
ex.setQueueCapacity(queueCapacity);
ex.setWaitForTasksToCompleteOnShutdown(true);
ex.setAwaitTerminationSeconds(120);
ex.initialize();
return ex;
}
}