mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-04-28 15:25:22 +00:00
Add shutdown hook for cleanup
This commit is contained in:
parent
d880a95aee
commit
aeaaba50f5
1 changed files with 6 additions and 0 deletions
|
|
@ -165,6 +165,12 @@ object PsLogin {
|
||||||
|
|
||||||
logger.info(s"NOTE: Set client.ini to point to ${LoginConfig.serverIpAddress.getHostAddress}:$loginServerPort")
|
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
|
// Wait forever until the actor system shuts down
|
||||||
Await.result(system.whenTerminated, Duration.Inf)
|
Await.result(system.whenTerminated, Duration.Inf)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue