fix(crawl-redis): batch scrape lockURL
Some checks are pending
Deploy Images to GHCR / push-app-image (push) Waiting to run

This commit is contained in:
Móricz Gergő 2024-11-12 11:52:34 +01:00
parent d8bb1f68c6
commit f6db9f1428

View File

@ -144,7 +144,7 @@ export async function lockURL(id: string, sc: StoredCrawl, url: string): Promise
await redisConnection.expire("crawl:" + id + ":visited_unique", 24 * 60 * 60, "NX"); await redisConnection.expire("crawl:" + id + ":visited_unique", 24 * 60 * 60, "NX");
let res: boolean; let res: boolean;
if (!sc.crawlerOptions.deduplicateSimilarURLs) { if (!sc.crawlerOptions?.deduplicateSimilarURLs) {
res = (await redisConnection.sadd("crawl:" + id + ":visited", url)) !== 0 res = (await redisConnection.sadd("crawl:" + id + ":visited", url)) !== 0
} else { } else {
const permutations = generateURLPermutations(url); const permutations = generateURLPermutations(url);