Skip to content

How to graceful shutdown #202

@ipratico

Description

@ipratico

Hello,
I'm using a graceful shutdown to close my express server:

process.on('SIGINT', function(){
   server.close(function(err) {
       process.exit(err ? 1 : 0);
   });
}); 

server.close() stops the server from accepting new connections and call the function after all the existing connections are finished. If someone has the page /status open the server won't close because the socket is still open and stays open until the page is closed.

Is there a way to force disconnect all the sockets connected?
I know that socket.io provides this function: io.disconnectSockets(), but how can I access to the "io" instance of express-status-monitor?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions