新需求更新 同步更新
This commit is contained in:
@@ -16,7 +16,7 @@ public class AppearancePatentProperties {
|
||||
private String cozeToken = "";
|
||||
private List<CozeCredential> cozeCredentials = new ArrayList<>();
|
||||
private int cozeCredentialStripeSize = 5;
|
||||
private int cozeBatchSize = 50;
|
||||
private int cozeBatchSize = 10;
|
||||
private int cozeConnectTimeoutMillis = 10000;
|
||||
private int cozeReadTimeoutMillis = 60000;
|
||||
private int cozePollIntervalMillis = 30000;
|
||||
|
||||
@@ -12,5 +12,7 @@ public class ModuleCleanupProperties {
|
||||
private boolean enabled = true;
|
||||
private String cron = "0 0 0 * * *";
|
||||
private long retentionDays = 7;
|
||||
private List<String> moduleTypes = new ArrayList<>(List.of("DEDUPE", "SPLIT", "CONVERT", "DELETE_BRAND", "PRODUCT_RISK_RESOLVE", "PRICE_TRACK", "SHOP_MATCH", "PATROL_DELETE", "QUERY_ASIN", "SHOP_DATA_CRAWL", "WITHDRAW", "APPEARANCE_PATENT", "SIMILAR_ASIN", "COLLECT_DATA"));
|
||||
// SHOP_DATA_CRAWL is governed by per-shop latest-three retention in its
|
||||
// task service and must not be removed by the age-based sweep.
|
||||
private List<String> moduleTypes = new ArrayList<>(List.of("DEDUPE", "SPLIT", "CONVERT", "DELETE_BRAND", "PRODUCT_RISK_RESOLVE", "PRICE_TRACK", "SHOP_MATCH", "PATROL_DELETE", "QUERY_ASIN", "WITHDRAW", "APPEARANCE_PATENT", "SIMILAR_ASIN", "COLLECT_DATA"));
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.nanri.aiimage.config;
|
||||
|
||||
import io.swagger.v3.oas.models.ExternalDocumentation;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.Components;
|
||||
import io.swagger.v3.oas.models.info.Contact;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.info.License;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@@ -39,6 +41,11 @@ public class OpenApiConfig {
|
||||
.version("v0.0.1")
|
||||
.contact(new Contact().name("Nanri AI"))
|
||||
.license(new License().name("Internal Use")))
|
||||
.components(new Components().addSecuritySchemes("bearerAuth", new SecurityScheme()
|
||||
.type(SecurityScheme.Type.HTTP)
|
||||
.scheme("bearer")
|
||||
.bearerFormat("JWT")
|
||||
.description("管理员登录 JWT")))
|
||||
.externalDocs(new ExternalDocumentation()
|
||||
.description("Knife4j 文档")
|
||||
.url("/doc.html"));
|
||||
|
||||
@@ -12,6 +12,7 @@ public class OssProperties {
|
||||
private String bucket;
|
||||
private String imageVideoBucket;
|
||||
private String digitalHumanBucket;
|
||||
private String templateBucket;
|
||||
private String accessKeyId;
|
||||
private String accessKeySecret;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.nanri.aiimage.config;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.TaskScheduler;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
|
||||
@@ -10,6 +12,8 @@ import java.time.Clock;
|
||||
import java.time.ZoneId;
|
||||
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
@ConditionalOnProperty(prefix = "aiimage.scheduling", name = "enabled", havingValue = "true", matchIfMissing = true)
|
||||
@Slf4j
|
||||
public class SchedulingConfig {
|
||||
|
||||
|
||||
@@ -61,13 +61,8 @@ public class SimilarAsinProperties {
|
||||
*/
|
||||
private int cozeSubmitMaxRetryCount = 5;
|
||||
|
||||
/**
|
||||
* 图片嵌入下载线程池大小。原 SimilarAsinImageEmbedder.DOWNLOAD_POOL_SIZE = 8。
|
||||
* P2-10:1000+ 行 ×3 列图片场景下,pool=16 仍是 assemble 阶段瓶颈(实测下载 244s/918s),
|
||||
* 提到 32 配合 retry=2、global deadline 显著拉低尾延迟;
|
||||
* 受 2GB 堆约束,单图缩略图维持 300KB 以内,整体内存峰值 ≈ 32 * 300KB ≈ 10MB。
|
||||
*/
|
||||
private int imageDownloadPoolSize = 32;
|
||||
/** 图片下载、解码和缩放共享该池;默认 8,避免批量结果生成占满整机 CPU。 */
|
||||
private int imageDownloadPoolSize = 8;
|
||||
|
||||
/**
|
||||
* 单张图片下载超时(秒)。
|
||||
@@ -77,6 +72,12 @@ public class SimilarAsinProperties {
|
||||
*/
|
||||
private int imageDownloadTimeoutSeconds = 5;
|
||||
|
||||
/** 单个结果文件整批图片预取预算,耗尽后缺图单元格降级为 URL。 */
|
||||
private int imagePrefetchTimeoutSeconds = 1800;
|
||||
|
||||
/** 多源结果文件组装的单任务硬上限;运行期间由文件任务 heartbeat 保活。 */
|
||||
private int resultFileTimeoutMinutes = 90;
|
||||
|
||||
/**
|
||||
* assemble 阶段 taskImageCache 的字节上限。
|
||||
* 默认 256MB:5000 行 × 3 列 × 平均 100KB = 1.5GB 远超 2GB 堆,
|
||||
@@ -85,6 +86,7 @@ public class SimilarAsinProperties {
|
||||
* 出现淘汰过频影响命中率时可上调到 512MB;2GB 堆约束下不建议超过 768MB。
|
||||
*/
|
||||
private long imageCacheMaxBytes = 256L * 1024L * 1024L;
|
||||
private String imageLocalCacheDir = "";
|
||||
private boolean imageDbCacheEnabled = false;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user