We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@doujiang24 , the gcd implement is not fair enough, the following is more better:
function _M:next() local servers=self.servers local selectedIdx for i = 1, #servers do servers[i]['cweight'] = servers[i]['weight'] + severs[i]['cweight'] if not selectedIdx or servers[selectedIdx]['cweight'] < severs[i]['cweight'] then selectedIdx = i end end servers[selectedIdx]['cweight'] = servers[selectedIdx]['cweight'] - self.totalWeight return servers[selectedIdx]['name'] end
The text was updated successfully, but these errors were encountered:
Possible related consequence of the current implementation: #44
Sorry, something went wrong.
No branches or pull requests
@doujiang24 , the gcd implement is not fair enough, the following is more better:
The text was updated successfully, but these errors were encountered: