File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed
apps/webapp/app/v3/services Expand file tree Collapse file tree 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(
202202 } ) ;
203203
204204 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+ } ) ;
205214 await marqs ?. updateQueueConcurrencyLimits (
206215 environment ,
207216 taskQueue . name ,
Original file line number Diff line number Diff line change @@ -439,9 +439,16 @@ export class TriggerTaskService extends BaseService {
439439
440440 if ( body . options ?. queue ) {
441441 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 ;
445452
446453 let taskQueue = await tx . taskQueue . findFirst ( {
447454 where : {
@@ -468,6 +475,16 @@ export class TriggerTaskService extends BaseService {
468475 } ) ;
469476
470477 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+ } ) ;
471488 await marqs ?. updateQueueConcurrencyLimits (
472489 environment ,
473490 taskQueue . name ,
You can’t perform that action at this time.
0 commit comments