@@ -206,18 +206,20 @@ export class QueueProcessorService implements OnApplicationShutdown {
206
206
//#endregion
207
207
208
208
//#region deliver
209
- this . deliverQueueWorkers = this . config . redisForDeliverQueues . map ( config => new Bull . Worker ( QUEUE . DELIVER , ( job ) => this . deliverProcessorService . process ( job ) , {
210
- ...baseWorkerOptions ( config , this . config . bullmqWorkerOptions , QUEUE . DELIVER ) ,
211
- autorun : false ,
212
- concurrency : this . config . deliverJobConcurrency ?? 128 ,
213
- limiter : {
214
- max : this . config . deliverJobPerSec ?? 128 ,
215
- duration : 1000 ,
216
- } ,
217
- settings : {
218
- backoffStrategy : httpRelatedBackoff ,
219
- } ,
220
- } ) ) ;
209
+ this . deliverQueueWorkers = this . config . redisForDeliverQueues
210
+ . filter ( ( _ , index ) => process . env . QUEUE_WORKER_INDEX == null || index === Number . parseInt ( process . env . QUEUE_WORKER_INDEX , 10 ) )
211
+ . map ( config => new Bull . Worker ( QUEUE . DELIVER , ( job ) => this . deliverProcessorService . process ( job ) , {
212
+ ...baseWorkerOptions ( config , this . config . bullmqWorkerOptions , QUEUE . DELIVER ) ,
213
+ autorun : false ,
214
+ concurrency : this . config . deliverJobConcurrency ?? 128 ,
215
+ limiter : {
216
+ max : this . config . deliverJobPerSec ?? 128 ,
217
+ duration : 1000 ,
218
+ } ,
219
+ settings : {
220
+ backoffStrategy : httpRelatedBackoff ,
221
+ } ,
222
+ } ) ) ;
221
223
222
224
this . deliverQueueWorkers . forEach ( ( worker , index ) => {
223
225
const deliverLogger = this . logger . createSubLogger ( `deliver-${ index } ` ) ;
0 commit comments