From 568d37812b4ab69271de0ac62024919ede933ca7 Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 11 Sep 2020 23:50:58 +0800 Subject: [PATCH] Add retry for syncing issues (#249, #482, #542, #567, #590) --- .../packet/chat/receive/MessageSvc.PbGetMsg.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PbGetMsg.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PbGetMsg.kt index ff083e7ca..71e9cbbaa 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PbGetMsg.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PbGetMsg.kt @@ -12,8 +12,11 @@ package net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive import kotlinx.atomicfu.loop +import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.FlowPreview +import kotlinx.coroutines.delay import kotlinx.coroutines.flow.* +import kotlinx.coroutines.launch import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import kotlinx.io.core.ByteReadPacket @@ -51,6 +54,7 @@ import net.mamoe.mirai.qqandroid.utils.toInt import net.mamoe.mirai.qqandroid.utils.toUHexString import net.mamoe.mirai.utils.debug import net.mamoe.mirai.utils.warning +import kotlin.random.Random /** @@ -141,6 +145,12 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory