handler to auto register and removed service registry, cleaned up queues and cache naming
This commit is contained in:
parent
0d1be9e3cb
commit
34c6c36695
19 changed files with 474 additions and 198 deletions
|
|
@ -45,7 +45,7 @@ export class Queue {
|
|||
const connection = getRedisConnection(redisConfig);
|
||||
|
||||
// Initialize BullMQ queue
|
||||
this.bullQueue = new BullQueue(`{${queueName}}`, {
|
||||
this.bullQueue = new BullQueue(queueName, {
|
||||
connection,
|
||||
defaultJobOptions: {
|
||||
removeOnComplete: 10,
|
||||
|
|
@ -61,7 +61,7 @@ export class Queue {
|
|||
|
||||
// Initialize queue events if workers will be used
|
||||
if (config.workers && config.workers > 0) {
|
||||
this.queueEvents = new QueueEvents(`{${queueName}}`, { connection });
|
||||
this.queueEvents = new QueueEvents(queueName, { connection });
|
||||
}
|
||||
|
||||
// Start workers if requested and not explicitly disabled
|
||||
|
|
@ -278,7 +278,7 @@ export class Queue {
|
|||
const connection = getRedisConnection(this.redisConfig);
|
||||
|
||||
for (let i = 0; i < workerCount; i++) {
|
||||
const worker = new Worker(`{${this.queueName}}`, this.processJob.bind(this), {
|
||||
const worker = new Worker(this.queueName, this.processJob.bind(this), {
|
||||
connection,
|
||||
concurrency,
|
||||
maxStalledCount: 3,
|
||||
|
|
@ -378,7 +378,7 @@ export class Queue {
|
|||
// Initialize queue events if not already done
|
||||
if (!this.queueEvents) {
|
||||
const connection = getRedisConnection(this.redisConfig);
|
||||
this.queueEvents = new QueueEvents(`{${this.queueName}}`, { connection });
|
||||
this.queueEvents = new QueueEvents(this.queueName, { connection });
|
||||
}
|
||||
|
||||
this.startWorkers(workerCount, concurrency);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue