Skip to content

Shutting down adapter #13

Open
Open
@michaelzangl

Description

@michaelzangl

I tried shutting down socket IO with the adapter installed. The node js process won't exit, since there are still timers active.

I expect this to work:

    socketIo.close();

There are still two timers running afterwards: the 30s cleanup timer and the ~2s reconnect timer

The workaround I found is:

    await socketIo.of('/').adapter.close(); // < this will clean the 30s cleanup timer
    socketIo.close();
    pool.connect = () => new Promise(() => {}); // < this will make the reconnect timer get blocked forever on the first reconnect attempt.

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