Merge pull request #1714 from murgatroid99/grpc-js_watchConnectivityState_closed

grpc-js: Throw in watchConnectivityState if channel is closed
This commit is contained in:
Michael Lumish 2021-03-12 10:11:09 -08:00 committed by GitHub
commit f7802ae6a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 =