nice-grpc
nice-grpc copied to clipboard
Memory leak waitForChannelReady
async function waitForChannelReady(channel, deadline) {
while (true) {
const state = channel.getConnectivityState(true);
if (state === grpc_js_1.connectivityState.READY) {
return;
}
await new Promise((resolve, reject) => {
channel.watchConnectivityState(state, deadline, err => {
if (err != null) {
reject(err);
}
else {
resolve();
}
});
});
}
}
The method does not have a way to clear the promise