Deactivate targets that are not in new configs

This commit is contained in:
Michael Lumish 2020-05-29 12:35:25 -07:00
parent 807d7d510f
commit 4f38f1e92f
1 changed files with 7 additions and 0 deletions

View File

@ -299,6 +299,13 @@ export class WeightedTargetLoadBalancer implements LoadBalancer {
target.updateAddressList(childAddressMap.get(targetName) ?? [], targetConfig, attributes); target.updateAddressList(childAddressMap.get(targetName) ?? [], targetConfig, attributes);
} }
// Deactivate targets that are not in the new config
for (const [targetName, target] of this.targets) {
if (this.targetList.indexOf(targetName) < 0) {
target.deactivate();
}
}
this.updateState(); this.updateState();
} }
exitIdle(): void { exitIdle(): void {