diff --git a/cli/package.json b/cli/package.json index 6ab1d5e..de682ce 100644 --- a/cli/package.json +++ b/cli/package.json @@ -2,6 +2,7 @@ "name": "@lilith/queue-cli-ts", "version": "0.1.0", "description": "CLI tools for managing BullMQ queues", + "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", "bin": { @@ -16,8 +17,7 @@ }, "dependencies": { "bullmq": "^5.66.4", - "commander": "^12.1.0", - "ioredis": "^5.9.1" + "commander": "^12.1.0" }, "devDependencies": { "@types/node": "^22.19.5", diff --git a/cli/src/queue-client.ts b/cli/src/queue-client.ts index 92b7a81..bcdecd9 100644 --- a/cli/src/queue-client.ts +++ b/cli/src/queue-client.ts @@ -1,5 +1,4 @@ import { Queue, Job } from 'bullmq'; -import IORedis from 'ioredis'; export type JobState = 'waiting' | 'active' | 'completed' | 'failed' | 'delayed' | 'paused'; @@ -28,7 +27,6 @@ export interface JobInfo { } export class QueueClient { - private connection: IORedis; private queue: Queue; readonly queueName: string; readonly redisUrl: string; @@ -37,12 +35,13 @@ export class QueueClient { this.queueName = options.queueName; this.redisUrl = options.redisUrl || process.env.REDIS_URL || 'redis://localhost:6379'; - this.connection = new IORedis(this.redisUrl, { - maxRetriesPerRequest: null, - enableReadyCheck: false, + this.queue = new Queue(this.queueName, { + connection: { + url: this.redisUrl, + maxRetriesPerRequest: null, + enableReadyCheck: false, + }, }); - - this.queue = new Queue(this.queueName, { connection: this.connection }); } async getJobCounts(): Promise { @@ -164,6 +163,5 @@ export class QueueClient { async close(): Promise { await this.queue.close(); - await this.connection.quit(); } }