From 91a1a9a1fc006dbb61b09e2ccc74f39d8890ae02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20M=C3=B3ricz?= Date: Mon, 9 Dec 2024 19:29:42 +0100 Subject: [PATCH] fix(crawl-redis/lockURL): reduce logging --- apps/api/src/lib/crawl-redis.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/api/src/lib/crawl-redis.ts b/apps/api/src/lib/crawl-redis.ts index e61f4892..5cc4d6a4 100644 --- a/apps/api/src/lib/crawl-redis.ts +++ b/apps/api/src/lib/crawl-redis.ts @@ -151,7 +151,6 @@ export async function lockURL(id: string, sc: StoredCrawl, url: string): Promise url = normalizeURL(url, sc); logger = logger.child({ url }); - logger.debug("Locking URL " + JSON.stringify(url) + "..."); await redisConnection.sadd("crawl:" + id + ":visited_unique", url); await redisConnection.expire("crawl:" + id + ":visited_unique", 24 * 60 * 60, "NX"); @@ -160,14 +159,14 @@ export async function lockURL(id: string, sc: StoredCrawl, url: string): Promise res = (await redisConnection.sadd("crawl:" + id + ":visited", url)) !== 0 } else { const permutations = generateURLPermutations(url).map(x => x.href); - logger.debug("Adding URL permutations for URL " + JSON.stringify(url) + "...", { permutations }); + // logger.debug("Adding URL permutations for URL " + JSON.stringify(url) + "...", { permutations }); const x = (await redisConnection.sadd("crawl:" + id + ":visited", ...permutations)); res = x === permutations.length; } await redisConnection.expire("crawl:" + id + ":visited", 24 * 60 * 60, "NX"); - logger.debug("lockURL final result: " + res, { res }); + logger.debug("Locking URL " + JSON.stringify(url) + "... result: " + res, { res }); return res; }