diff --git a/bun.lockb b/bun.lockb index b43abc6..a359614 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/app/api/workflow/workflowQueue.ts b/src/app/api/workflow/workflowQueue.ts index 7e8879f..5e9d2d7 100644 --- a/src/app/api/workflow/workflowQueue.ts +++ b/src/app/api/workflow/workflowQueue.ts @@ -1,4 +1,6 @@ import { Queue } from "bullmq"; + +import Redis from "ioredis"; import { env } from "~/env"; import { db } from "~/server/db"; import { workflowJobs, workflowRuns } from "~/server/db/schema"; @@ -8,11 +10,12 @@ import { Logger } from "@/lib/log"; const log = new Logger("workflowQueue"); +const connection = new Redis(env.REDIS_URL, { + maxRetriesPerRequest: null, +}); export const workflowQueue = new Queue("workflowQueue", { - connection: { - path: env.REDIS_URL, - }, + connection, defaultJobOptions: { attempts: 2, backoff: { diff --git a/src/components/main-nav.tsx b/src/components/main-nav.tsx index 5fade69..bee423b 100644 --- a/src/components/main-nav.tsx +++ b/src/components/main-nav.tsx @@ -44,7 +44,7 @@ export function MainNav() { onClick={() => resetReactFlow()} className={cn( "transition-colors hover:text-foreground/80", - pathname === "/workflow" ? "text-foreground" : "text-foreground/60", + /\/workflow(?!s)/.test(pathname) ? "text-foreground" : "text-foreground/60", )} > Builder diff --git a/src/instrumentation.ts b/src/instrumentation.ts index 0ff75ba..168fa43 100644 --- a/src/instrumentation.ts +++ b/src/instrumentation.ts @@ -14,8 +14,12 @@ export const register = async () => { console.log("Registering worker"); console.log("Worker ID", WORKER_ID); const { Worker } = await import("bullmq"); + const Redis = (await import("ioredis")).default; const updateWorkflowRun = (await import("~/app/api/workflow/workflowQueue")) .updateWorkflowRun; + const connection = new Redis(env.REDIS_URL, { + maxRetriesPerRequest: null, + }); new Worker( "workflowQueue", @@ -45,9 +49,7 @@ export const register = async () => { return res.map((obj: any) => obj.track.id); }, { - connection: { - path: env.REDIS_URL, - }, + connection, concurrency: 5, removeOnComplete: { count: 1000 }, removeOnFail: { count: 5000 }, diff --git a/worker/bun.lockb b/worker/bun.lockb index ec4aad6..a842b56 100755 Binary files a/worker/bun.lockb and b/worker/bun.lockb differ diff --git a/worker/package.json b/worker/package.json index db5dd1d..dce0d8d 100644 --- a/worker/package.json +++ b/worker/package.json @@ -13,9 +13,9 @@ "@planetscale/database": "^1.11.0", "@sentry/nextjs": "^7.93.0", "@types/spotify-api": "^0.0.25", - "bullmq": "^5.1.1", + "bullmq": "^5.7.2", "drizzle-orm": "latest", - "ioredis": "^5.3.2", + "ioredis": "^5.4.1", "million": "latest", "next-auth": "^4.24.5", "spotify-web-api-node": "^5.0.2",