aboutsummaryrefslogtreecommitdiffstats
path: root/shared/queues.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/queues.ts')
-rw-r--r--shared/queues.ts16
1 files changed, 12 insertions, 4 deletions
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<typeof zCrawlLinkRequestSchema>;
+export const LinkCrawlerQueue = new Queue<ZCrawlLinkRequest, void>(
+ "link_crawler_queue",
+ { connection: queueConnectionDetails },
+);