Skip to content

Commit

Permalink
fix(adaptive-crawler): if no sitemap, use recursive instead
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleeit committed Oct 8, 2024
1 parent ee29be5 commit 5a4b35e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/functions/src/cloud-functions/adaptive-crawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,12 @@ export class AdaptiveCrawlerHost extends RPCHost {
failed: {},
});

let urls: string[] = [];
if (useSitemap) {
const urls = await this.crawlUrlsFromSitemap(targetUrl, maxPages);
urls = await this.crawlUrlsFromSitemap(targetUrl, maxPages);
}

if (urls.length > 0) {
await AdaptiveCrawlTask.COLLECTION.doc(shortDigest).update({
status: AdaptiveCrawlTaskStatus.PROCESSING,
statusText: `Processing 0/${urls.length}`,
Expand Down

0 comments on commit 5a4b35e

Please sign in to comment.