From a8dbd761eb8086f1150d8b11361ff1b04bf69ac7 Mon Sep 17 00:00:00 2001 From: Him188 Date: Thu, 24 Jun 2021 00:42:57 +0800 Subject: [PATCH] Use `start=UNDISPATCHED` in `launchRecovery` --- .../kotlin/network/components/BotOfflineEventMonitor.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mirai-core/src/commonMain/kotlin/network/components/BotOfflineEventMonitor.kt b/mirai-core/src/commonMain/kotlin/network/components/BotOfflineEventMonitor.kt index 35587837b..d1c6d2e31 100644 --- a/mirai-core/src/commonMain/kotlin/network/components/BotOfflineEventMonitor.kt +++ b/mirai-core/src/commonMain/kotlin/network/components/BotOfflineEventMonitor.kt @@ -10,6 +10,7 @@ package net.mamoe.mirai.internal.network.components import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.CoroutineStart import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.launch import net.mamoe.mirai.event.ConcurrencyKind @@ -95,7 +96,7 @@ internal class BotOfflineEventMonitorImpl : BotOfflineEventMonitor { } private fun launchRecovery(bot: AbstractBot) { - bot.launch { + bot.launch(start = CoroutineStart.UNDISPATCHED) { val success: Boolean val time = measureTimeMillis { success = kotlin.runCatching {