File tree 2 files changed +29
-3
lines changed
apps/webapp/app/v3/services
2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,15 @@ export async function createBackgroundTasks(
202
202
} ) ;
203
203
204
204
if ( typeof taskQueue . concurrencyLimit === "number" ) {
205
+ logger . debug ( "CreateBackgroundWorkerService: updating concurrency limit" , {
206
+ workerId : worker . id ,
207
+ taskQueue,
208
+ orgId : environment . organizationId ,
209
+ projectId : environment . projectId ,
210
+ environmentId : environment . id ,
211
+ concurrencyLimit,
212
+ taskidentifier : task . id ,
213
+ } ) ;
205
214
await marqs ?. updateQueueConcurrencyLimits (
206
215
environment ,
207
216
taskQueue . name ,
Original file line number Diff line number Diff line change @@ -439,9 +439,16 @@ export class TriggerTaskService extends BaseService {
439
439
440
440
if ( body . options ?. queue ) {
441
441
const concurrencyLimit =
442
- typeof body . options . queue . concurrencyLimit === "number"
443
- ? Math . max ( 0 , body . options . queue . concurrencyLimit )
444
- : undefined ;
442
+ typeof body . options . queue ?. concurrencyLimit === "number"
443
+ ? Math . max (
444
+ Math . min (
445
+ body . options . queue . concurrencyLimit ,
446
+ environment . maximumConcurrencyLimit ,
447
+ environment . organization . maximumConcurrencyLimit
448
+ ) ,
449
+ 0
450
+ )
451
+ : null ;
445
452
446
453
let taskQueue = await tx . taskQueue . findFirst ( {
447
454
where : {
@@ -468,6 +475,16 @@ export class TriggerTaskService extends BaseService {
468
475
} ) ;
469
476
470
477
if ( typeof taskQueue . concurrencyLimit === "number" ) {
478
+ logger . debug ( "TriggerTaskService: updating concurrency limit" , {
479
+ runId : taskRun . id ,
480
+ friendlyId : taskRun . friendlyId ,
481
+ taskQueue,
482
+ orgId : environment . organizationId ,
483
+ projectId : environment . projectId ,
484
+ existingConcurrencyLimit,
485
+ concurrencyLimit,
486
+ queueOptions : body . options ?. queue ,
487
+ } ) ;
471
488
await marqs ?. updateQueueConcurrencyLimits (
472
489
environment ,
473
490
taskQueue . name ,
You can’t perform that action at this time.
0 commit comments