@@ -380,26 +380,36 @@ async function createWorkerQueue(
380
380
prisma
381
381
) ;
382
382
383
- if ( typeof concurrencyLimit === "number" ) {
384
- logger . debug ( "createWorkerQueue: updating concurrency limit" , {
385
- workerId : worker . id ,
386
- taskQueue,
387
- orgId : environment . organizationId ,
388
- projectId : environment . projectId ,
389
- environmentId : environment . id ,
390
- concurrencyLimit,
391
- } ) ;
392
- await updateQueueConcurrencyLimits ( environment , taskQueue . name , concurrencyLimit ) ;
383
+ if ( ! taskQueue . paused ) {
384
+ if ( typeof concurrencyLimit === "number" ) {
385
+ logger . debug ( "createWorkerQueue: updating concurrency limit" , {
386
+ workerId : worker . id ,
387
+ taskQueue,
388
+ orgId : environment . organizationId ,
389
+ projectId : environment . projectId ,
390
+ environmentId : environment . id ,
391
+ concurrencyLimit,
392
+ } ) ;
393
+ await updateQueueConcurrencyLimits ( environment , taskQueue . name , concurrencyLimit ) ;
394
+ } else {
395
+ logger . debug ( "createWorkerQueue: removing concurrency limit" , {
396
+ workerId : worker . id ,
397
+ taskQueue,
398
+ orgId : environment . organizationId ,
399
+ projectId : environment . projectId ,
400
+ environmentId : environment . id ,
401
+ concurrencyLimit,
402
+ } ) ;
403
+ await removeQueueConcurrencyLimits ( environment , taskQueue . name ) ;
404
+ }
393
405
} else {
394
- logger . debug ( "createWorkerQueue: removing concurrency limit" , {
406
+ logger . debug ( "createWorkerQueue: queue is paused, not updating concurrency limit" , {
395
407
workerId : worker . id ,
396
408
taskQueue,
397
409
orgId : environment . organizationId ,
398
410
projectId : environment . projectId ,
399
411
environmentId : environment . id ,
400
- concurrencyLimit,
401
412
} ) ;
402
- await removeQueueConcurrencyLimits ( environment , taskQueue . name ) ;
403
413
}
404
414
405
415
return taskQueue ;
0 commit comments