Skip to content

Commit

Permalink
fix: possible server stop exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Suqatri committed Jul 13, 2024
1 parent e36915a commit 2272505
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ class ServerProcess(
val answer = response.withTimeOut(4.seconds).waitBlocking()
if (answer != null) {
var seconds = 0
while (cloudServer!!.connected && seconds < SERVER_STOP_TIMEOUT) {
while (cloudServer != null && cloudServer?.connected == true && seconds < SERVER_STOP_TIMEOUT) {
withContext(Dispatchers.IO) {
Thread.sleep(1000)
}
seconds++
cloudServer = serverRepository.getServer(serverId)!!
cloudServer = serverRepository.getServer(serverId)
}
if (cloudServer!!.connected) {
if (cloudServer?.connected == true) {
logger.warning("§cServer ${toConsoleValue(cloudServer!!.name, false)} stop request timed out. Stopping process manually!")
}
} else {
Expand Down

0 comments on commit 2272505

Please sign in to comment.