Skip to content

Commit 9a462a6

Browse files
fix(run-engine): decrement totalWeight in #weightedShuffle after splice (#4001)
1 parent f9900fa commit 9a462a6

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

internal-packages/run-engine/src/run-queue/fairQueueSelectionStrategy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ export class FairQueueSelectionStrategy implements RunQueueSelectionStrategy {
226226

227227
// Add selected item to result and remove from items
228228
result.push(items[index].envId);
229+
totalWeight -= items[index].weight;
229230
items.splice(index, 1);
230231
}
231232

0 commit comments

Comments
 (0)