Skip to content

Commit ad49229

Browse files
review
1 parent bc56592 commit ad49229

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/actor-scraper/sitemap-scraper/src/internals/crawler_setup.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class CrawlerSetup implements CrawlerSetupOptions {
119119
);
120120
const discovered = await Promise.race([
121121
discoveryPromise,
122-
sleep(SITEMAP_DISCOVERY_TIMEOUT_MILLIS).then(() => null),
122+
sleep(SITEMAP_DISCOVERY_TIMEOUT_MILLIS),
123123
]);
124124
if (!discovered) {
125125
log.warning(
@@ -128,7 +128,10 @@ export class CrawlerSetup implements CrawlerSetupOptions {
128128
)}s, continuing without sitemaps.`,
129129
);
130130
}
131-
const discoveredSitemaps = new Set(discovered ?? []);
131+
const discoveredSitemaps =
132+
discovered && discovered.length > 0
133+
? new Set(discovered)
134+
: new Set<string>();
132135
if (discoveredSitemaps.size === 0) {
133136
throw await Actor.fail(
134137
'No valid sitemaps were discovered from the provided startUrls.',

0 commit comments

Comments
 (0)