Skip to content

Commit

Permalink
feat: do loadBalancer close when address_group close
Browse files Browse the repository at this point in the history
  • Loading branch information
mansonchor committed Apr 12, 2022
1 parent 512634e commit a88bf21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/client/address_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ class AddressGroup extends Base {
if (this._healthCounter) {
this._healthCounter.close();
}
if (this._loadbalancer && this._loadbalancer.close) {
this._loadbalancer.close();
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions lib/client/loadbalancer/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ class LoadBalancer extends Base {
getWeight(address) {
return this.addressGroup.getWeight(address);
}

close() {
// do nothing here, for override
}
}

module.exports = LoadBalancer;

0 comments on commit a88bf21

Please sign in to comment.