nice-grpc icon indicating copy to clipboard operation
nice-grpc copied to clipboard

Memory leak waitForChannelReady

Open polRk opened this issue 3 months ago • 0 comments

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

polRk avatar Nov 19 '25 08:11 polRk