Skip to content

Commit

Permalink
feat(CostSurface): Tweaks batch processing order of Imports because o…
Browse files Browse the repository at this point in the history
…f CostSurface addition
  • Loading branch information
KevSanchez authored and hotzevzl committed Oct 3, 2023
1 parent ef9811e commit 2ef8b84
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,13 @@ export class Import extends AggregateRoot {
);
if (isThisTheLastBatch || !hasThisBatchFinished) return right(true);

const nextBatchOrder = Math.min(
...this.pieces
.filter((piece) => piece.order > pieceToComplete.order)
.map((piece) => piece.order),
);
const nextBatch = this.pieces.filter(
(piece) => piece.order === pieceToComplete.order + 1,
(piece) => piece.order === nextBatchOrder,
);

for (const component of nextBatch) {
Expand Down

0 comments on commit 2ef8b84

Please sign in to comment.