-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecated: Add balance mode split one chevs (Updated) #248
Conversation
@@ -213,17 +213,14 @@ defmodule Teiserver.Game.BalancerServer do | |||
|> Enum.map(fn userid -> | |||
%{ | |||
userid => | |||
BalanceLib.get_user_balance_rating_value(userid, rating_type) | |||
|> fuzz_rating(opts[:fuzz_multiplier]) | |||
BalanceLib.get_user_rating_rank(userid, rating_type, opts[:fuzz_multiplier]) | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So before it would iterate and call another function per user to get the rating. I thought it was ok because it uses a cache. I'm doing the same thing but now adding on rank and name, which is also cached.
If you can think of a better a solution...
As requested I've moved the changes to the other PR |
Fixes #218
See issue ticket for details and test instructions.
Incorporating changes suggested by geekingfrog from previous PR.
Dependency to Account module has been removed from the split one chevs balance algorithm. However, inside balancer_server there is a function that iterates over user ids and fetches user information. Previously this information was only rating. Now it includes name and rank. While in code this looks like a db call, it wouldn't be in production because it uses a cache after the data is fetched once. It would be fetched once during login.
loser_picks (written by Teifion) still has a dependency to Teiserver.Account and the reason why units tests pass is because Teifion is using
which I think sets up a connection to the database during the test. I am not confident to change this module but can raise a ticket if needed. But as stated earlier, in production it would be using the cache not a db call.