@@ -112,7 +112,7 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
112
112
} catch ( error ) {
113
113
// Detect a prisma transaction Unique constraint violation
114
114
if ( error instanceof Prisma . PrismaClientKnownRequestError ) {
115
- logger . debug ( "BatchTriggerV3 : Prisma transaction error" , {
115
+ logger . debug ( "RunEngineBatchTrigger : Prisma transaction error" , {
116
116
code : error . code ,
117
117
message : error . message ,
118
118
meta : error . meta ,
@@ -188,15 +188,15 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
188
188
189
189
switch ( result . status ) {
190
190
case "COMPLETE" : {
191
- logger . debug ( "[BatchTriggerV3 ][call] Batch inline processing complete" , {
191
+ logger . debug ( "[RunEngineBatchTrigger ][call] Batch inline processing complete" , {
192
192
batchId : batch . friendlyId ,
193
193
currentIndex : 0 ,
194
194
} ) ;
195
195
196
196
return batch ;
197
197
}
198
198
case "INCOMPLETE" : {
199
- logger . debug ( "[BatchTriggerV3 ][call] Batch inline processing incomplete" , {
199
+ logger . debug ( "[RunEngineBatchTrigger ][call] Batch inline processing incomplete" , {
200
200
batchId : batch . friendlyId ,
201
201
currentIndex : result . workingIndex ,
202
202
} ) ;
@@ -218,7 +218,7 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
218
218
return batch ;
219
219
}
220
220
case "ERROR" : {
221
- logger . error ( "[BatchTriggerV3 ][call] Batch inline processing error" , {
221
+ logger . error ( "[RunEngineBatchTrigger ][call] Batch inline processing error" , {
222
222
batchId : batch . friendlyId ,
223
223
currentIndex : result . workingIndex ,
224
224
error : result . error ,
@@ -317,15 +317,15 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
317
317
}
318
318
319
319
async processBatchTaskRun ( options : BatchProcessingOptions ) {
320
- logger . debug ( "[BatchTriggerV3 ][processBatchTaskRun] Processing batch" , {
320
+ logger . debug ( "[RunEngineBatchTrigger ][processBatchTaskRun] Processing batch" , {
321
321
options,
322
322
} ) ;
323
323
324
324
const $attemptCount = options . attemptCount + 1 ;
325
325
326
326
// Add early return if max attempts reached
327
327
if ( $attemptCount > MAX_ATTEMPTS ) {
328
- logger . error ( "[BatchTriggerV3 ][processBatchTaskRun] Max attempts reached" , {
328
+ logger . error ( "[RunEngineBatchTrigger ][processBatchTaskRun] Max attempts reached" , {
329
329
options,
330
330
attemptCount : $attemptCount ,
331
331
} ) ;
@@ -351,12 +351,15 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
351
351
352
352
// Check to make sure the currentIndex is not greater than the runCount
353
353
if ( options . range . start >= batch . runCount ) {
354
- logger . debug ( "[BatchTriggerV3][processBatchTaskRun] currentIndex is greater than runCount" , {
355
- options,
356
- batchId : batch . friendlyId ,
357
- runCount : batch . runCount ,
358
- attemptCount : $attemptCount ,
359
- } ) ;
354
+ logger . debug (
355
+ "[RunEngineBatchTrigger][processBatchTaskRun] currentIndex is greater than runCount" ,
356
+ {
357
+ options,
358
+ batchId : batch . friendlyId ,
359
+ runCount : batch . runCount ,
360
+ attemptCount : $attemptCount ,
361
+ }
362
+ ) ;
360
363
361
364
return ;
362
365
}
@@ -373,7 +376,7 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
373
376
const payload = await parsePacket ( payloadPacket ) ;
374
377
375
378
if ( ! payload ) {
376
- logger . debug ( "[BatchTriggerV3 ][processBatchTaskRun] Failed to parse payload" , {
379
+ logger . debug ( "[RunEngineBatchTrigger ][processBatchTaskRun] Failed to parse payload" , {
377
380
options,
378
381
batchId : batch . friendlyId ,
379
382
attemptCount : $attemptCount ,
@@ -399,7 +402,7 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
399
402
400
403
switch ( result . status ) {
401
404
case "COMPLETE" : {
402
- logger . debug ( "[BatchTriggerV3 ][processBatchTaskRun] Batch processing complete" , {
405
+ logger . debug ( "[RunEngineBatchTrigger ][processBatchTaskRun] Batch processing complete" , {
403
406
options,
404
407
batchId : batch . friendlyId ,
405
408
attemptCount : $attemptCount ,
@@ -408,7 +411,7 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
408
411
return ;
409
412
}
410
413
case "INCOMPLETE" : {
411
- logger . debug ( "[BatchTriggerV3 ][processBatchTaskRun] Batch processing incomplete" , {
414
+ logger . debug ( "[RunEngineBatchTrigger ][processBatchTaskRun] Batch processing incomplete" , {
412
415
batchId : batch . friendlyId ,
413
416
currentIndex : result . workingIndex ,
414
417
attemptCount : $attemptCount ,
@@ -434,7 +437,7 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
434
437
return ;
435
438
}
436
439
case "ERROR" : {
437
- logger . error ( "[BatchTriggerV3 ][processBatchTaskRun] Batch processing error" , {
440
+ logger . error ( "[RunEngineBatchTrigger ][processBatchTaskRun] Batch processing error" , {
438
441
batchId : batch . friendlyId ,
439
442
currentIndex : result . workingIndex ,
440
443
error : result . error ,
@@ -505,7 +508,7 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
505
508
// Grab the next PROCESSING_BATCH_SIZE items
506
509
const itemsToProcess = items . slice ( currentIndex , currentIndex + batchSize ) ;
507
510
508
- logger . debug ( "[BatchTriggerV3 ][processBatchTaskRun] Processing batch items" , {
511
+ logger . debug ( "[RunEngineBatchTrigger ][processBatchTaskRun] Processing batch items" , {
509
512
batchId : batch . friendlyId ,
510
513
currentIndex,
511
514
runCount : batch . runCount ,
@@ -528,19 +531,19 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
528
531
} ) ;
529
532
530
533
if ( ! run ) {
531
- logger . error ( "[BatchTriggerV3 ][processBatchTaskRun] Failed to process item" , {
534
+ logger . error ( "[RunEngineBatchTrigger ][processBatchTaskRun] Failed to process item" , {
532
535
batchId : batch . friendlyId ,
533
536
currentIndex : workingIndex ,
534
537
} ) ;
535
538
536
- throw new Error ( "[BatchTriggerV3 ][processBatchTaskRun] Failed to process item" ) ;
539
+ throw new Error ( "[RunEngineBatchTrigger ][processBatchTaskRun] Failed to process item" ) ;
537
540
}
538
541
539
542
runIds . push ( run . friendlyId ) ;
540
543
541
544
workingIndex ++ ;
542
545
} catch ( error ) {
543
- logger . error ( "[BatchTriggerV3 ][processBatchTaskRun] Failed to process item" , {
546
+ logger . error ( "[RunEngineBatchTrigger ][processBatchTaskRun] Failed to process item" , {
544
547
batchId : batch . friendlyId ,
545
548
currentIndex : workingIndex ,
546
549
error,
@@ -595,7 +598,7 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
595
598
parentRunId : string | undefined ;
596
599
resumeParentOnCompletion : boolean | undefined ;
597
600
} ) {
598
- logger . debug ( "[BatchTriggerV3 ][processBatchTaskRunItem] Processing item" , {
601
+ logger . debug ( "[RunEngineBatchTrigger ][processBatchTaskRunItem] Processing item" , {
599
602
batchId : batch . friendlyId ,
600
603
currentIndex,
601
604
} ) ;
@@ -634,7 +637,7 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
634
637
async #enqueueBatchTaskRun( options : BatchProcessingOptions , tx ?: PrismaClientOrTransaction ) {
635
638
await workerQueue . enqueue ( "runengine.processBatchTaskRun" , options , {
636
639
tx,
637
- jobKey : `BatchTriggerV3Service .process:${ options . batchId } :${ options . processingId } ` ,
640
+ jobKey : `RunEngineBatchTriggerService .process:${ options . batchId } :${ options . processingId } ` ,
638
641
} ) ;
639
642
}
640
643
0 commit comments