mirror of https://github.com/grpc/grpc-node.git
Merge pull request #1714 from murgatroid99/grpc-js_watchConnectivityState_closed
grpc-js: Throw in watchConnectivityState if channel is closed
This commit is contained in:
commit
f7802ae6a7
|
|
@ -480,6 +480,9 @@ export class ChannelImplementation implements Channel {
|
||||||
deadline: Date | number,
|
deadline: Date | number,
|
||||||
callback: (error?: Error) => void
|
callback: (error?: Error) => void
|
||||||
): void {
|
): void {
|
||||||
|
if (this.connectivityState === ConnectivityState.SHUTDOWN) {
|
||||||
|
throw new Error('Channel has been shut down');
|
||||||
|
}
|
||||||
let timer = null;
|
let timer = null;
|
||||||
if(deadline !== Infinity) {
|
if(deadline !== Infinity) {
|
||||||
const deadlineDate: Date =
|
const deadlineDate: Date =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue