From baf48af5f0a4b88642edc18ae8b16e81260e1846 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Tue, 6 Feb 2024 18:16:35 +0000 Subject: Implement metadata fetching logic in the crawler --- shared/queues.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'shared/queues.ts') diff --git a/shared/queues.ts b/shared/queues.ts index 4303eaa2..ac5acc57 100644 --- a/shared/queues.ts +++ b/shared/queues.ts @@ -1,10 +1,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"), + host: process.env.REDIS_HOST || "localhost", + port: parseInt(process.env.REDIS_PORT || "6379"), }; -export const LinkCrawlerQueue = new Queue("link_crawler_queue", { connection: queueConnectionDetails }); - +export const zCrawlLinkRequestSchema = z.object({ + linkId: z.string(), + url: z.string().url(), +}); +export type ZCrawlLinkRequest = z.infer; +export const LinkCrawlerQueue = new Queue( + "link_crawler_queue", + { connection: queueConnectionDetails }, +); -- cgit v1.2.3-70-g09d2