priority changes
This commit is contained in:
@@ -134,7 +134,7 @@ export async function crawlController(req: Request, res: Response) {
|
|||||||
},
|
},
|
||||||
opts: {
|
opts: {
|
||||||
jobId: uuid,
|
jobId: uuid,
|
||||||
priority: 2,
|
priority: 20,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@@ -153,7 +153,7 @@ export async function crawlController(req: Request, res: Response) {
|
|||||||
origin: req.body.origin ?? defaultOrigin,
|
origin: req.body.origin ?? defaultOrigin,
|
||||||
crawl_id: id,
|
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);
|
await addCrawlJob(id, job.id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export async function addScrapeJob(
|
|||||||
jobId: string = uuidv4(),
|
jobId: string = uuidv4(),
|
||||||
): Promise<Job> {
|
): Promise<Job> {
|
||||||
return await getScrapeQueue().add(jobId, webScraperOptions, {
|
return await getScrapeQueue().add(jobId, webScraperOptions, {
|
||||||
priority: webScraperOptions.crawl_id ? 2 : 1,
|
priority: webScraperOptions.crawl_id ? 20 : 10,
|
||||||
...options,
|
...options,
|
||||||
jobId,
|
jobId,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user