File tree Expand file tree Collapse file tree
packages/actor-scraper/sitemap-scraper/src/internals Expand file tree Collapse file tree Original file line number Diff line number Diff 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.' ,
You can’t perform that action at this time.
0 commit comments