Skip to content

Commit f2dbc11

Browse files
committed
Chore: Remove the return value of a single crawl function
1 parent 423a7d0 commit f2dbc11

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/api.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ function createCrawlFileConfig(
684684
async function pageSingleCrawlHandle(
685685
device: Device<LoaderCrawlPageDetail, PageSingleCrawlResult>,
686686
extraConfig: ExtraPageConfig
687-
): Promise<PageSingleCrawlResult> {
687+
) {
688688
const {
689689
detailTargetConfig,
690690
detailTargetResult,
@@ -752,8 +752,6 @@ async function pageSingleCrawlHandle(
752752

753753
pageSingleResultHandle(device, extraConfig)
754754
}
755-
756-
return { response, page }
757755
}
758756

759757
async function dataAndFileSingleCrawlHandle(
@@ -790,8 +788,6 @@ async function dataAndFileSingleCrawlHandle(
790788
fileSingleResultHandle(device, extraConfig as ExtraFileConfig)
791789
}
792790
}
793-
794-
return await request(detailTargetConfig)
795791
}
796792

797793
/* Single result handle */

src/batchCrawl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function asyncBatchCrawl<
2929
>(
3030
devices: Device<T, R>[],
3131
extraConfig: E,
32-
singleCrawlHandle: (device: Device<T, R>, extraConfig: E) => Promise<R>
32+
singleCrawlHandle: (device: Device<T, R>, extraConfig: E) => Promise<void>
3333
) {
3434
const { intervalTime } = extraConfig
3535

@@ -61,7 +61,7 @@ export async function syncBatchCrawl<
6161
>(
6262
devices: Device<T, R>[],
6363
extraConfig: E,
64-
singleCrawlHandle: (device: Device<T, R>, extraConfig: E) => Promise<R>
64+
singleCrawlHandle: (device: Device<T, R>, extraConfig: E) => Promise<void>
6565
) {
6666
const { intervalTime } = extraConfig
6767

src/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export async function controller<
8585
mode: 'async' | 'sync',
8686
detailTargets: T[],
8787
extraConfig: E,
88-
singleCrawlHandle: (device: Device<T, R>, extraConfig: E) => Promise<R>
88+
singleCrawlHandle: (device: Device<T, R>, extraConfig: E) => Promise<void>
8989
) {
9090
// 是否使用优先爬取
9191
const isPriorityCrawl = !detailTargets.every(

0 commit comments

Comments
 (0)