Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions apps/webapp/app/runEngine/services/batchTrigger.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,18 @@ export class RunEngineBatchTriggerService extends WithRunEngine {

switch (this._batchProcessingStrategy) {
case "sequential": {
await this.#enqueueBatchTaskRun({
batchId: batch.id,
processingId: batchId,
range: { start: 0, count: PROCESSING_BATCH_SIZE },
attemptCount: 0,
strategy: this._batchProcessingStrategy,
parentRunId: body.parentRunId,
resumeParentOnCompletion: body.resumeParentOnCompletion,
});
await this.#enqueueBatchTaskRun(
{
batchId: batch.id,
processingId: batchId,
range: { start: 0, count: PROCESSING_BATCH_SIZE },
attemptCount: 0,
strategy: this._batchProcessingStrategy,
parentRunId: body.parentRunId,
resumeParentOnCompletion: body.resumeParentOnCompletion,
},
tx
);

break;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/webapp/test/fairDequeuingStrategy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ describe("FairDequeuingStrategy", () => {

console.log("Second distribution took", distribute2Duration, "ms");

// Make sure the second call is more than 9 times faster than the first
expect(distribute2Duration).toBeLessThan(withTolerance(distribute1Duration / 9));
// Make sure the second call is more than 2 times faster than the first
expect(distribute2Duration).toBeLessThan(withTolerance(distribute1Duration / 2));

const startDistribute3 = performance.now();

Expand Down