refactor(队列): coze 残留改名到 task-queue / LLM,直连改造后不再出现第三方平台名
货源查询与外观专利早已改成直连 LLM,但配置键、指标名、类名与注释里的 "coze" 还留着,
排查线上问题时按平台名 grep 到的是已经不参与调用的历史命名。
对外可见的两处改名(运维需同步):
- 配置键 aiimage.coze-task.{max-concurrent,max-waiting} -> aiimage.task-queue.*
- 指标 aiimage.coze-task.submit.rejected.total / .execution.duration / .queue.wait.duration
-> aiimage.task-queue.* (Grafana 面板与告警表达式要一起改,否则曲线断流)
SimilarAsinTaskServiceCozeBufferScopeTest 随之改名(git 识别为 R)。
OSS 签名域名测试改用 example-cdn.com 占位,不再依赖真实 coze.cn 域名形态。
SimilarAsinTaskServiceTest 补上 result.notice 两条口径的测试:缺必填字段的行显示「未检测」
而不是留白(28551:790/1000 行空白仍报成功),404 行优先显示「ASIN未找到」。
This commit is contained in:
@@ -4,7 +4,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* LLM 客户端统一配置解析(task-168,Coze 已改直连 LLM)。
|
||||
* LLM 客户端统一配置解析(task-168)。
|
||||
*
|
||||
* 从 aiimage.http-client.* 命名空间读取 LLM 客户端超时/重试,默认值与现状一致
|
||||
* (connect 10s / read 60s / call 90s / retry 3);非法值钳制。模块级显式配置
|
||||
|
||||
@@ -106,8 +106,8 @@ public class TaskFileJobConfig {
|
||||
@Bean("taskQueueExecutor")
|
||||
public TaskExecutor taskQueueExecutor(
|
||||
@Qualifier("taskQueueVirtualThreadExecutor") ExecutorService taskQueueVirtualThreadExecutor,
|
||||
@Value("${aiimage.coze-task.max-concurrent:12}") int maxConcurrent,
|
||||
@Value("${aiimage.coze-task.max-waiting:1000}") int maxWaiting,
|
||||
@Value("${aiimage.task-queue.max-concurrent:12}") int maxConcurrent,
|
||||
@Value("${aiimage.task-queue.max-waiting:1000}") int maxWaiting,
|
||||
ObjectProvider<MeterRegistry> meterRegistryProvider) {
|
||||
Semaphore semaphore = new Semaphore(Math.max(1, maxConcurrent));
|
||||
TaskExecutor semaphoreLimited = new ConcurrentTaskExecutor(command -> {
|
||||
|
||||
@@ -101,14 +101,14 @@ public class TaskQueueGate implements TaskExecutor {
|
||||
private void recordRejected(String reason) {
|
||||
MeterRegistry registry = meterRegistry();
|
||||
if (registry != null) {
|
||||
registry.counter("aiimage.coze-task.submit.rejected.total", "reason", reason).increment();
|
||||
registry.counter("aiimage.task-queue.submit.rejected.total", "reason", reason).increment();
|
||||
}
|
||||
}
|
||||
|
||||
private void recordQueueWait(long waitNanos) {
|
||||
MeterRegistry registry = meterRegistry();
|
||||
if (registry != null && waitNanos >= 0L) {
|
||||
Timer.builder("aiimage.coze-task.queue.wait.duration")
|
||||
Timer.builder("aiimage.task-queue.queue.wait.duration")
|
||||
.register(registry)
|
||||
.record(waitNanos, TimeUnit.NANOSECONDS);
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public class TaskQueueGate implements TaskExecutor {
|
||||
private void recordExecution(long durationNanos) {
|
||||
MeterRegistry registry = meterRegistry();
|
||||
if (registry != null && durationNanos >= 0L) {
|
||||
Timer.builder("aiimage.coze-task.execution.duration")
|
||||
Timer.builder("aiimage.task-queue.execution.duration")
|
||||
.register(registry)
|
||||
.record(durationNanos, TimeUnit.NANOSECONDS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user