Skip to content

Commit 7ec2726

Browse files
committed
Some fixes in the new batch trigger service… mostly just passing missing optional params through
1 parent 509438d commit 7ec2726

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/webapp/app/v3/services/batchTriggerV3.server.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ export class BatchTriggerV3Service extends WithRunEngine {
261261
batchId: batch.id,
262262
environmentId: environment.id,
263263
projectId: environment.projectId,
264+
tx,
264265
});
265266
}
266267

@@ -389,6 +390,8 @@ export class BatchTriggerV3Service extends WithRunEngine {
389390
batchSize: options.range.count,
390391
items: $payload,
391392
options: $options,
393+
parentRunId: options.parentRunId,
394+
resumeParentOnCompletion: options.resumeParentOnCompletion,
392395
});
393396

394397
switch (result.status) {
@@ -549,7 +552,7 @@ export class BatchTriggerV3Service extends WithRunEngine {
549552
}
550553

551554
//add the run ids to the batch
552-
await this._prisma.batchTaskRun.update({
555+
const updatedBatch = await this._prisma.batchTaskRun.update({
553556
where: { id: batch.id },
554557
data: {
555558
runIds: {
@@ -563,7 +566,7 @@ export class BatchTriggerV3Service extends WithRunEngine {
563566
return { status: "INCOMPLETE", workingIndex };
564567
}
565568

566-
if (parentRunId) {
569+
if (parentRunId && updatedBatch.runIds.length === updatedBatch.runCount) {
567570
await this._engine.unblockRunForCreatedBatch({
568571
runId: RunId.fromFriendlyId(parentRunId),
569572
batchId: batch.id,

0 commit comments

Comments
 (0)