Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

priority changes

Gergő Móricz57730f6a3506
diff --git a/apps/api/src/controllers/crawl.ts b/apps/api/src/controllers/crawl.ts
index 7c3e63288..4f3c5f22a 100644
--- a/apps/api/src/controllers/crawl.ts
+++ b/apps/api/src/controllers/crawl.ts
@@ -134,7 +134,7 @@ export async function crawlController(req: Request, res: Response) {
},
opts: {
jobId: uuid,
- priority: 2,
+ priority: 20,
}
};
})
@@ -153,7 +153,7 @@ export async function crawlController(req: Request, res: Response) {
origin: req.body.origin ?? defaultOrigin,
crawl_id: id,
}, {
- priority: 1, // prioritize request 0 of crawl jobs same as scrape jobs
+ priority: 15, // prioritize request 0 of crawl jobs same as scrape jobs
});
await addCrawlJob(id, job.id);
}
diff --git a/apps/api/src/services/queue-jobs.ts b/apps/api/src/services/queue-jobs.ts
index 0f0d2c99d..3099da681 100644
--- a/apps/api/src/services/queue-jobs.ts
+++ b/apps/api/src/services/queue-jobs.ts
@@ -9,7 +9,7 @@ export async function addScrapeJob(
jobId: string = uuidv4(),
): Promise<Job> {
return await getScrapeQueue().add(jobId, webScraperOptions, {
- priority: webScraperOptions.crawl_id ? 2 : 1,
+ priority: webScraperOptions.crawl_id ? 20 : 10,
...options,
jobId,
});