Add shutdown hook for cleanup

This commit is contained in:
Chord 2016-07-26 02:54:38 -04:00
parent d880a95aee
commit aeaaba50f5

View file

@ -165,6 +165,12 @@ object PsLogin {
logger.info(s"NOTE: Set client.ini to point to ${LoginConfig.serverIpAddress.getHostAddress}:$loginServerPort")
// Add our shutdown hook (this works for Control+C as well, but not in Cygwin)
sys addShutdownHook {
// TODO: clean up active sessions and close resources safely
logger.info("Login server now shutting down...")
}
// Wait forever until the actor system shuts down
Await.result(system.whenTerminated, Duration.Inf)
}