Skip to content

Commit efee33f

Browse files
committed
fix: replace weight calculation with a rounded ceil
1 parent 16df6eb commit efee33f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/utils/DecisionUtil.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ let DecisionUtil = {
10131013
) {
10141014
// normalise the weights of all the shortlisted campaigns
10151015
shortlistedCampaigns.forEach(campaign => {
1016-
campaign.weight = Math.floor(100 / shortlistedCampaigns.length);
1016+
campaign.weight = Math.ceil((100 / shortlistedCampaigns.length) * 10) / 10;
10171017
});
10181018

10191019
// re-distribute the traffic for each camapign

0 commit comments

Comments
 (0)