mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-21 09:02:07 -07:00
Slight improvements to server shutdown
This commit is contained in:
parent
2e3370f5ce
commit
23a7d2a1b1
2 changed files with 3 additions and 2 deletions
|
|
@ -35,6 +35,7 @@ public final class SystemTermination {
|
|||
public void terminate() {
|
||||
SystemLogger.logInfo("[SystemTerminator] Initializing termination sequence - do not shutdown!");
|
||||
try {
|
||||
Server.setRunning(false);
|
||||
for(Player player : Repository.getPlayers()){
|
||||
DMCHandler dmc = player.getAttribute("dmc",null);
|
||||
if(dmc != null){
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ object Server {
|
|||
|
||||
var lastHeartbeat = System.currentTimeMillis()
|
||||
|
||||
@JvmStatic
|
||||
var running = false
|
||||
|
||||
/**
|
||||
|
|
@ -102,9 +103,8 @@ object Server {
|
|||
GlobalScope.launch {
|
||||
delay(20000)
|
||||
while(running){
|
||||
if(System.currentTimeMillis() - lastHeartbeat > 1800){
|
||||
if(System.currentTimeMillis() - lastHeartbeat > 1800 && running){
|
||||
SystemLogger.logErr("Triggering reboot due to heartbeat timeout")
|
||||
running = false
|
||||
exitProcess(0)
|
||||
}
|
||||
delay(625)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue