task-9: 进度类请求默认 10s 超时(progressTimeoutMs 可配置覆盖,postTaskProgressBatch 接入)

This commit is contained in:
2026-08-31 19:23:13 +08:00
parent 980e6e91e0
commit 9349f8ff33
3 changed files with 79 additions and 2 deletions
+4 -2
View File
@@ -7,7 +7,7 @@
type JavaApiResponse,
unwrapJavaResponse,
} from "@/shared/api/http";
import { getTaskProgressCacheTtlMs } from "@/shared/task-progress-config";
import { getTaskProgressCacheTtlMs, getTaskProgressTimeoutMs } from "@/shared/task-progress-config";
import { createTaskProgressRequestCache } from "@/shared/task-progress-request-cache";
const JAVA_API_PREFIX = "/newApi/api";
@@ -71,7 +71,9 @@ async function postTaskProgressBatch<T>(
}
const requestPromise = unwrapJavaResponse(
post<JavaApiResponse<T>, { taskIds: number[] }>(path, { taskIds: normalizedTaskIds }),
post<JavaApiResponse<T>, { taskIds: number[] }>(path, { taskIds: normalizedTaskIds }, {
timeout: getTaskProgressTimeoutMs(),
}),
)
.then((data) => {
taskProgressResponseCache.set(cacheKey, data);