task-47: 轮询 baseline 统计补强测试
This commit is contained in:
@@ -194,6 +194,7 @@ export function useTaskProgressLoop<TDetail>(
|
||||
try {
|
||||
const result = await options.fetchProgress(ids)
|
||||
const items = result?.items || []
|
||||
baseline?.recordResponseItems(items, (detail) => options.extractTaskId(detail))
|
||||
const terminalEvents: Array<{ taskId: number; detail: TDetail | undefined; status: string }> = []
|
||||
const nextStatuses = { ...taskStatuses.value }
|
||||
for (const detail of items) {
|
||||
@@ -226,6 +227,7 @@ export function useTaskProgressLoop<TDetail>(
|
||||
}
|
||||
} catch (error) {
|
||||
if (!disposed) {
|
||||
baseline?.recordFailure()
|
||||
const attempt = failureCount
|
||||
failureCount = Math.min(failureCount + 1, 100)
|
||||
options.onError?.(error, attempt)
|
||||
|
||||
Reference in New Issue
Block a user