chore(shared): 🔧 Update shared dependency versions and build configuration files
This commit is contained in:
parent
6ded39d579
commit
9a1411f937
2 changed files with 8 additions and 10 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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<JobCounts> {
|
||||
|
|
@ -164,6 +163,5 @@ export class QueueClient {
|
|||
|
||||
async close(): Promise<void> {
|
||||
await this.queue.close();
|
||||
await this.connection.quit();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue