fix(task-board): 任务卡片假死自救——轮询失败退避重试+面板刷新按钮+补检轮进度文案
task 31769:外观专利任务后端 18:08 已 SUCCESS,但页面卡片冻在「正在组装 xlsx 92%」 一天多——Patent 轮询配的 propagate 让一次瞬时错误永久杀死轮询,且无自救出口。 - useLiveTaskBoard 摘除 pollErrorMode:失败一律吞掉重试,连续失败按倍数降频(封顶 5x) - TaskCenterPanel 头部新增「刷新」按钮,外观专利/货源查询两页接上(强拉 history+dashboard) - 补检轮触发时进度文案改「有 N 行未完成检测,补检中」,不再停在「正在组装 xlsx」假死 - 回归:AppearancePatentRecheckProgressMessageTest+task-board-poll-resilience.test.ts
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
<section class="right-panel">
|
||||
<TaskCenterPanel
|
||||
:on-batch-delete="batchDeleteHistory"
|
||||
:on-refresh="refreshBoard"
|
||||
title="外观专利检测"
|
||||
:cards="patentCards"
|
||||
:current-items="currentTaskViews"
|
||||
@@ -171,8 +172,6 @@ const board = useLiveTaskBoard<AppearancePatentHistoryItem>({
|
||||
}
|
||||
return { taskIds, force: true }
|
||||
},
|
||||
// 轮询回调抛错时上抛、轮询停止(与原实现一致)
|
||||
pollErrorMode: 'propagate',
|
||||
getPendingParseItem: () => pendingParseItem.value,
|
||||
download: {
|
||||
buildUrl: (resultId) => getAppearancePatentResultDownloadUrl(resultId),
|
||||
@@ -188,6 +187,16 @@ const board = useLiveTaskBoard<AppearancePatentHistoryItem>({
|
||||
})
|
||||
|
||||
const visibleTaskSummary = computed(() => parseResult.value || queuedTaskSummary.value)
|
||||
|
||||
/** 手动刷新:强拉历史 + 统计 + 当前轮询任务进度(轮询意外中断后的自救出口) */
|
||||
async function refreshBoard() {
|
||||
await Promise.all([
|
||||
board.loadDashboard(),
|
||||
board.loadHistory({ force: true }),
|
||||
board.refreshTaskProgress(),
|
||||
])
|
||||
}
|
||||
|
||||
const pendingParseItem = computed<AppearancePatentHistoryItem | null>(() => {
|
||||
const result = parseResult.value
|
||||
if (!result?.taskId) return null
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
<section class="right-panel">
|
||||
<TaskCenterPanel
|
||||
:on-batch-delete="batchDeleteHistory"
|
||||
:on-refresh="refreshBoard"
|
||||
title="货源查询"
|
||||
:cards="asinCards"
|
||||
:current-items="currentTaskViews"
|
||||
@@ -221,8 +222,6 @@ const board = useLiveTaskBoard<SimilarAsinHistoryItem>({
|
||||
pendingIds.forEach((taskId) => forceThrottle.markForce(taskId))
|
||||
}
|
||||
},
|
||||
// 瞬时请求失败不打断轮询(与原实现一致)
|
||||
pollErrorMode: 'swallow',
|
||||
onPendingFileTaskRemoved: (taskId) => forceThrottle.clear(taskId),
|
||||
getPendingParseItem: () => pendingParseItem.value,
|
||||
download: {
|
||||
@@ -270,6 +269,15 @@ const currentTaskViews = computed<TaskItemView[]>(() => board.currentItems.value
|
||||
|
||||
const historyTaskViews = computed<TaskItemView[]>(() => board.historyOnlyItems.value.map(toAsinTaskView))
|
||||
|
||||
/** 手动刷新:强拉历史 + 统计 + 当前轮询任务进度(轮询意外中断后的自救出口) */
|
||||
async function refreshBoard() {
|
||||
await Promise.all([
|
||||
board.loadDashboard(),
|
||||
board.loadHistory({ force: true }),
|
||||
board.refreshTaskProgress(),
|
||||
])
|
||||
}
|
||||
|
||||
function itemSource(item: TaskItemView): SimilarAsinHistoryItem {
|
||||
return item.source as SimilarAsinHistoryItem
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user