blob: ac5acc57a4e739ee9d16d3cf513783e225a2f0be (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import { Queue } from "bullmq";
import { z } from "zod";
export const queueConnectionDetails = {
host: process.env.REDIS_HOST || "localhost",
port: parseInt(process.env.REDIS_PORT || "6379"),
};
export const zCrawlLinkRequestSchema = z.object({
linkId: z.string(),
url: z.string().url(),
});
export type ZCrawlLinkRequest = z.infer<typeof zCrawlLinkRequestSchema>;
export const LinkCrawlerQueue = new Queue<ZCrawlLinkRequest, void>(
"link_crawler_queue",
{ connection: queueConnectionDetails },
);
|