diff options
Diffstat (limited to 'apps/workers/crawlerWorker.ts')
| -rw-r--r-- | apps/workers/crawlerWorker.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/workers/crawlerWorker.ts b/apps/workers/crawlerWorker.ts index 49e9495d..246e9050 100644 --- a/apps/workers/crawlerWorker.ts +++ b/apps/workers/crawlerWorker.ts @@ -214,7 +214,7 @@ async function getBookmarkDetails(bookmarkId: string) { }); if (!bookmark || !bookmark.link) { - throw new Error("The bookmark either doesn't exist or not a link"); + throw new Error("The bookmark either doesn't exist or is not a link"); } return { url: bookmark.link.url, @@ -519,6 +519,7 @@ async function crawlAndParseUrl( oldScreenshotAssetId: string | undefined, oldImageAssetId: string | undefined, oldFullPageArchiveAssetId: string | undefined, + archiveFullPage: boolean, ) { const { htmlContent, @@ -578,7 +579,7 @@ async function crawlAndParseUrl( ]); return async () => { - if (serverConfig.crawler.fullPageArchive) { + if (serverConfig.crawler.fullPageArchive || archiveFullPage) { const fullPageArchiveAssetId = await archiveWebpage( htmlContent, browserUrl, @@ -615,7 +616,7 @@ async function runCrawler(job: DequeuedJob<ZCrawlLinkRequest>) { return; } - const { bookmarkId } = request.data; + const { bookmarkId, archiveFullPage } = request.data; const { url, userId, @@ -654,6 +655,7 @@ async function runCrawler(job: DequeuedJob<ZCrawlLinkRequest>) { oldScreenshotAssetId, oldImageAssetId, oldFullPageArchiveAssetId, + archiveFullPage, ); } |
