Skip to content

Commit 920ccb8

Browse files
committed
Update: When retrying, the number of times will be displayed
1 parent 6c4fd09 commit 920ccb8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/controller.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export async function controller<
7777
// 选择爬取模式
7878
const batchCrawl = mode === 'async' ? asyncBatchCrawl : syncBatchCrawl
7979

80+
let i = 0
8081
let crawlQueue: ControllerConfig<T, V>[] = controllerConfigs
8182
while (crawlQueue.length) {
8283
await batchCrawl(
@@ -95,7 +96,9 @@ export async function controller<
9596

9697
if (crawlQueue.length) {
9798
const retriedIds = crawlQueue.map((item) => item.id)
98-
log(logWarn(`Ids to retry: [ ${retriedIds.join(' - ')} ]`))
99+
log(
100+
logWarn(`Retry: ${++i} - Ids to retry: [ ${retriedIds.join(' - ')} ]`)
101+
)
99102
}
100103
}
101104

0 commit comments

Comments
 (0)