fix timeout

This commit is contained in:
creeper123123321 2021-04-08 20:54:51 -03:00
parent ba14be1782
commit 1ce9ee1406

View File

@ -13,11 +13,8 @@ import io.ipinfo.api.IPInfo
import io.ktor.client.request.* import io.ktor.client.request.*
import io.ktor.http.cio.websocket.* import io.ktor.http.cio.websocket.*
import io.ktor.websocket.* import io.ktor.websocket.*
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.*
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.time.delay import kotlinx.coroutines.time.delay
import kotlinx.coroutines.withContext
import java.net.InetSocketAddress import java.net.InetSocketAddress
import java.net.SocketAddress import java.net.SocketAddress
import java.time.Duration import java.time.Duration
@ -88,7 +85,7 @@ class WebDashboardServer {
) )
it.ws.flush() it.ws.flush()
} }
GlobalScope.run { GlobalScope.launch {
delay(Duration.ofSeconds(20)) delay(Duration.ofSeconds(20))
future.completeExceptionally(StacklessException("No response from browser")) future.completeExceptionally(StacklessException("No response from browser"))
} }