package com.ai.trackwalker.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

@Configuration
public class ModelArtifactAsyncConfig {
    @Bean(name = "modelArtifactTaskExecutor")
    public ThreadPoolTaskExecutor modelArtifactTaskExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(2);
        executor.setMaxPoolSize(4);
        executor.setQueueCapacity(50);
        executor.setThreadNamePrefix("model-artifact-");
        executor.initialize();
        return executor;
    }
}
