mirror of
https://github.com/robindhole/Low-Level-Design.git
synced 2025-03-15 19:00:43 +00:00
Update WeightedRoundRobin.java
assignTo should not be negative i believe
This commit is contained in:
parent
c992cb240a
commit
022dd4891b
@ -28,6 +28,7 @@ public class WeightedRoundRobin implements Router {
|
||||
synchronized (this.lock) {
|
||||
nodes.remove(node);
|
||||
assignTo--;
|
||||
if(assignTo < 0 ) assignTo = 0;
|
||||
currentNodeAssignments = 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user