mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-04 20:00:39 +08:00
23 lines
602 B
TypeScript
23 lines
602 B
TypeScript
import Queue from "bull";
|
|
import { Queue as BullQueue } from "bull";
|
|
|
|
let webScraperQueue: BullQueue;
|
|
|
|
export function getWebScraperQueue() {
|
|
if (!webScraperQueue) {
|
|
webScraperQueue = new Queue("web-scraper", process.env.REDIS_URL, {
|
|
settings: {
|
|
lockDuration: 1 * 60 * 1000, // 1 minute in milliseconds,
|
|
lockRenewTime: 15 * 1000, // 15 seconds in milliseconds
|
|
stalledInterval: 30 * 1000,
|
|
maxStalledCount: 10,
|
|
},
|
|
defaultJobOptions:{
|
|
attempts: 5
|
|
}
|
|
});
|
|
console.log("Web scraper queue created");
|
|
}
|
|
return webScraperQueue;
|
|
}
|