修复接口内容缺失

This commit is contained in:
super
2026-04-08 16:14:26 +08:00
parent 3149d80456
commit 2e30821e0f
15 changed files with 947 additions and 350 deletions

View File

@@ -7,7 +7,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "aiimage.delete-brand-progress")
public class DeleteBrandProgressProperties {
private long heartbeatTimeoutMinutes = 15;
private String staleCheckCron = "0 */2 * * * *";
private String staleCheckCron = "*/30 * * * * *";
/**
* 定时补偿 finalize用于“分片其实已齐但最后一次提交断开导致没触发 finalize”的场景。
@@ -15,7 +15,8 @@ public class DeleteBrandProgressProperties {
private String finalizeCheckCron = "30 */2 * * * *";
/**
* 商品风险PRODUCT_RISK_RESOLVERUNNING 超时自动失败:与删除品牌共用同一定时调度。
* 商品风险PRODUCT_RISK_RESOLVERUNNING 超时自动收尾/失败,按分钟计算;
* 与删除品牌共用同一定时调度。
*/
private long productRiskStaleTimeoutHours = 48;
private long productRiskStaleTimeoutMinutes = 1;
}

View File

@@ -0,0 +1,24 @@
package com.nanri.aiimage.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
@Configuration
@Slf4j
public class SchedulingConfig {
@Bean
public TaskScheduler taskScheduler() {
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
scheduler.setPoolSize(4);
scheduler.setThreadNamePrefix("aiimage-scheduling-");
scheduler.setWaitForTasksToCompleteOnShutdown(true);
scheduler.setAwaitTerminationSeconds(30);
scheduler.setErrorHandler(ex -> log.warn("[scheduling] task execution failed: {}", ex.getMessage(), ex));
scheduler.initialize();
return scheduler;
}
}