Skip to content

Commit 5e28e14

Browse files
committed
v4: fix stuck batch issue when processing happens before transaction commits
1 parent 3f2b748 commit 5e28e14

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

apps/webapp/app/runEngine/services/batchTrigger.server.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,18 @@ export class RunEngineBatchTriggerService extends WithRunEngine {
273273

274274
switch (this._batchProcessingStrategy) {
275275
case "sequential": {
276-
await this.#enqueueBatchTaskRun({
277-
batchId: batch.id,
278-
processingId: batchId,
279-
range: { start: 0, count: PROCESSING_BATCH_SIZE },
280-
attemptCount: 0,
281-
strategy: this._batchProcessingStrategy,
282-
parentRunId: body.parentRunId,
283-
resumeParentOnCompletion: body.resumeParentOnCompletion,
284-
});
276+
await this.#enqueueBatchTaskRun(
277+
{
278+
batchId: batch.id,
279+
processingId: batchId,
280+
range: { start: 0, count: PROCESSING_BATCH_SIZE },
281+
attemptCount: 0,
282+
strategy: this._batchProcessingStrategy,
283+
parentRunId: body.parentRunId,
284+
resumeParentOnCompletion: body.resumeParentOnCompletion,
285+
},
286+
tx
287+
);
285288

286289
break;
287290
}

0 commit comments

Comments
 (0)