fix: maybe don't block the IO thread for seconds at a time

This commit is contained in:
Johannes Frohnmeyer 2024-05-12 17:36:39 +02:00
parent 501084ca58
commit 464f339240
Signed by: Johannes
GPG Key ID: E76429612C2929F4

View File

@ -19,6 +19,7 @@ import io.ktor.client.request.*
import io.ktor.http.* import io.ktor.http.*
import io.ktor.serialization.kotlinx.json.* import io.ktor.serialization.kotlinx.json.*
import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@ -220,7 +221,7 @@ object SDom {
result.forEach { resultFlow.emit(Result.success(it)) } result.forEach { resultFlow.emit(Result.success(it)) }
break break
} else { } else {
Thread.sleep(1000) delay(1000)
} }
} while (true) } while (true)
} catch (e: Exception) { } catch (e: Exception) {