Skip to content

Memory leak waitForChannelReady #831

@polRk

Description

@polRk
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions