34 lines
990 B
Java
34 lines
990 B
Java
package com.guo.learningprogresstracker.config;
|
|
|
|
import lombok.Data;
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
/**
|
|
* AI 异步任务配置(AI-02)。
|
|
*/
|
|
@Data
|
|
@Configuration
|
|
@ConfigurationProperties(prefix = "lpt.ai-task")
|
|
public class AiTaskProperties {
|
|
|
|
/** 单个任务允许的最长执行时间(秒):超过则视为进程中断,回收后可重试 */
|
|
private long stuckTimeoutSeconds = 900;
|
|
|
|
/** 兜底扫描间隔(毫秒) */
|
|
private long scanIntervalMs = 3000;
|
|
|
|
/** 首次兜底扫描的延迟(毫秒):让「提交后立即投递」先执行 */
|
|
private long scanInitialDelayMs = 3000;
|
|
|
|
/** 单次扫描最多处理多少个任务 */
|
|
private int scanBatchSize = 10;
|
|
|
|
/** 立即投递用的线程池大小 */
|
|
private int executorCoreSize = 2;
|
|
|
|
private int executorMaxSize = 4;
|
|
|
|
private int executorQueueCapacity = 50;
|
|
}
|