mirror of
https://github.com/robindhole/Low-Level-Design.git
synced 2025-03-15 20:29:51 +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) {
|
synchronized (this.lock) {
|
||||||
nodes.remove(node);
|
nodes.remove(node);
|
||||||
assignTo--;
|
assignTo--;
|
||||||
|
if(assignTo < 0 ) assignTo = 0;
|
||||||
currentNodeAssignments = 0;
|
currentNodeAssignments = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user