feat: AI 调用改为异步任务并支持结果重复获取
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user