grpc-js: Throw in watchConnectivityState if channel is closed

This commit is contained in:
Michael Lumish 2021-03-12 09:39:50 -08:00
parent b374a83a71
commit 602fcd23b4
1 changed files with 3 additions and 0 deletions

View File

@ -480,6 +480,9 @@ export class ChannelImplementation implements Channel {
deadline: Date | number,
callback: (error?: Error) => void
): void {
if (this.connectivityState === ConnectivityState.SHUTDOWN) {
throw new Error('Channel has been shut down');
}
let timer = null;
if(deadline !== Infinity) {
const deadlineDate: Date =