mirror of https://github.com/grpc/grpc-node.git
grpc-js: deadline filter: reject promise if call ends
This commit is contained in:
parent
669a6ef3a4
commit
d77da26021
|
@ -62,7 +62,13 @@ export class DeadlineFilter extends BaseFilter implements Filter {
|
|||
'connectivityStateChanged', handleStateChange);
|
||||
}
|
||||
};
|
||||
const handleStatus = () => {
|
||||
reject(new Error('Call ended'));
|
||||
this.channel.removeListener(
|
||||
'connectivityStateChanged', handleStateChange);
|
||||
};
|
||||
this.channel.on('connectivityStateChanged', handleStateChange);
|
||||
this.callStream.once('status', handleStatus);
|
||||
}
|
||||
})
|
||||
.then((finalMetadata: Metadata) => {
|
||||
|
|
Loading…
Reference in New Issue