Skip to content

Commit

Permalink
fix: replace weight calculation with a rounded ceil
Browse files Browse the repository at this point in the history
  • Loading branch information
samc committed Nov 3, 2023
1 parent 16df6eb commit efee33f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/DecisionUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ let DecisionUtil = {
) {
// normalise the weights of all the shortlisted campaigns
shortlistedCampaigns.forEach(campaign => {
campaign.weight = Math.floor(100 / shortlistedCampaigns.length);
campaign.weight = Math.ceil((100 / shortlistedCampaigns.length) * 10) / 10;
});

// re-distribute the traffic for each camapign
Expand Down

0 comments on commit efee33f

Please sign in to comment.