Skip to content

Commit b468bb4

Browse files
committed
crawl fixes
1 parent 103c3f2 commit b468bb4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

apps/api/src/lib/crawl-redis.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ export async function lockURL(id: string, sc: StoredCrawl, url: string): Promise
148148
res = (await redisConnection.sadd("crawl:" + id + ":visited", url)) !== 0
149149
} else {
150150
const permutations = generateURLPermutations(url);
151-
res = (await redisConnection.sadd("crawl:" + id + ":visited", ...permutations.map(x => x.href))) === permutations.length;
151+
const x = (await redisConnection.sadd("crawl:" + id + ":visited", ...permutations.map(x => x.href)));
152+
res = x === permutations.length;
152153
}
153154

154155
await redisConnection.expire("crawl:" + id + ":visited", 24 * 60 * 60, "NX");

apps/api/src/services/queue-worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ async function processJob(job: Job & { id: string }, token: string) {
350350

351351
await addCrawlJobDone(job.data.crawl_id, job.id);
352352

353-
if (!job.data.sitemapped && job.data.crawlerOptions !== null) {
353+
if (job.data.crawlerOptions !== null) {
354354
if (!sc.cancelled) {
355355
const crawler = crawlToCrawler(job.data.crawl_id, sc, doc.metadata.url ?? doc.metadata.sourceURL ?? sc.originUrl);
356356

0 commit comments

Comments
 (0)