추세검색 설정 수정
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 추세검색 전용 단일 스레드 실행기 — 메인 API·라이브 전략 스케줄과 분리.
|
||||
*/
|
||||
@Configuration
|
||||
public class TrendSearchSchedulerConfig {
|
||||
|
||||
@Bean(name = "trendSearchExecutor")
|
||||
public Executor trendSearchExecutor(
|
||||
@Value("${goldenchart.trend-search.scheduler.queue-capacity:16}") int queueCapacity) {
|
||||
ThreadPoolTaskExecutor ex = new ThreadPoolTaskExecutor();
|
||||
ex.setThreadNamePrefix("trend-search-");
|
||||
ex.setCorePoolSize(1);
|
||||
ex.setMaxPoolSize(1);
|
||||
ex.setQueueCapacity(queueCapacity);
|
||||
ex.setWaitForTasksToCompleteOnShutdown(true);
|
||||
ex.setAwaitTerminationSeconds(30);
|
||||
ex.initialize();
|
||||
return ex;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user