task-9: 进度类请求默认 10s 超时(progressTimeoutMs 可配置覆盖,postTaskProgressBatch 接入)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user