Skip to content
Snippets Groups Projects
Commit be7b2424 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Catch all exceptions on Socket.IO shutdown. A thrown exception would

prevent the Socket.IO server from stopping and cause a redeployment to
fail because of the still running server.
parent 6de672f7
No related merge requests found
......@@ -136,9 +136,14 @@ public class ARSnovaSocketIOServer {
}
public void stopServer() throws Exception {
logger.debug("In stopServer method of class: {}", getClass().getName());
for (SocketIOClient client : server.getAllClients()) {
client.disconnect();
logger.trace("In stopServer method of class: {}", getClass().getName());
try {
for (SocketIOClient client : server.getAllClients()) {
client.disconnect();
}
} catch (Exception e) {
/* If exceptions are not caught they could prevent the Socket.IO server from shutting down. */
logger.error("Exception caught on Socket.IO shutdown: {}", e.getStackTrace());
}
server.stop();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment