Update WeightedRoundRobin.java

assignTo should not be negative i believe
This commit is contained in:
Palash Nandi 2020-07-29 07:27:17 +05:30 committed by GitHub
parent c992cb240a
commit 022dd4891b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,7 @@ public class WeightedRoundRobin implements Router {
synchronized (this.lock) { synchronized (this.lock) {
nodes.remove(node); nodes.remove(node);
assignTo--; assignTo--;
if(assignTo < 0 ) assignTo = 0;
currentNodeAssignments = 0; currentNodeAssignments = 0;
} }
} }