fix(frontend): 支持请求级自定义超时并将接单模板初始化与批量回填超时延长至5分钟
- 在 http 客户端封装中增加可选 RequestOptions 参数透传,允许对耗时较长的数据初始化/大批量回填接口单独配置超时 - 将 applyAdminTemplateProductBootstrap、syncAdminAffiliateDashCostSnapshots、backfillAdminProductMappings 及 backfillAdminNormalizedQuantities 客户端超时由 50 秒延长至 300 秒(5分钟) - 彻底解决生产全量订单数据规模下接单模板初始化触发 50 秒网络超时提示的问题 - 验证方式:npm --prefix apps/frontend run typecheck 通过,生产镜像构建运行正常
This commit is contained in:
@@ -51,6 +51,7 @@ export function applyAdminTemplateProductBootstrap() {
|
||||
return apiPost<TemplateProductBootstrapResult>(
|
||||
'/api/v1/admin/cost-center/template-bootstrap/apply',
|
||||
{ repair: true },
|
||||
{ timeout: 300_000 },
|
||||
)
|
||||
}
|
||||
|
||||
@@ -160,7 +161,7 @@ export function syncAdminAffiliateDashCostSnapshots() {
|
||||
insertedCount: number
|
||||
batchCount: number
|
||||
}
|
||||
}>('/api/v1/admin/cost-center/affiliate-products/sync-snapshots')
|
||||
}>('/api/v1/admin/cost-center/affiliate-products/sync-snapshots', {}, { timeout: 300_000 })
|
||||
}
|
||||
|
||||
|
||||
@@ -233,7 +234,7 @@ export function backfillAdminProductMappings(payload: Record<string, unknown>) {
|
||||
limit: number
|
||||
batches: number
|
||||
remainingCount: number
|
||||
}>('/api/v1/admin/cost-center/mappings/backfill', payload)
|
||||
}>('/api/v1/admin/cost-center/mappings/backfill', payload, { timeout: 300_000 })
|
||||
}
|
||||
|
||||
export function backfillAdminNormalizedQuantities(payload: Record<string, unknown>) {
|
||||
@@ -242,7 +243,7 @@ export function backfillAdminNormalizedQuantities(payload: Record<string, unknow
|
||||
limit: number
|
||||
batches: number
|
||||
remainingCount: number
|
||||
}>('/api/v1/admin/cost-center/normalized-quantities/backfill', payload)
|
||||
}>('/api/v1/admin/cost-center/normalized-quantities/backfill', payload, { timeout: 300_000 })
|
||||
}
|
||||
|
||||
export function fetchAdminCostItems(params?: Record<string, unknown>) {
|
||||
|
||||
Reference in New Issue
Block a user