refactor: simplify if statements

This commit is contained in:
Joram 2019-11-05 09:59:41 +01:00
parent 20cbfc7e9f
commit 93f8169139
2 changed files with 2 additions and 4 deletions

View File

@ -289,9 +289,7 @@ export class ChannelImplementation implements Channel {
this.resolvingLoadBalancer.destroy();
this.updateState(ConnectivityState.SHUTDOWN);
if (this.subchannelPool !== undefined) {
this.subchannelPool.forceCleanup();
}
this.subchannelPool.forceCleanup();
}
getTarget() {

View File

@ -92,7 +92,7 @@ export class SubchannelPool {
* Ensure that the cleanup task is spawned.
*/
ensureCleanupTask(): void {
if (this.global === true && this.cleanupTimer === undefined) {
if (this.global && this.cleanupTimer === undefined) {
this.cleanupTimer = setInterval(() => {
this.unrefUnusedSubchannels();
}, REF_CHECK_INTERVAL);