Skip to content

Commit 3d9b598

Browse files
committed
Improve Heartbeat
1 parent 61ca490 commit 3d9b598

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt

+8
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,14 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
338338
suspend fun doHeartBeat(): Exception? {
339339
val lastException: Exception?
340340
try {
341+
kotlin.runCatching {
342+
Heartbeat.Alive(bot.client)
343+
.sendAndExpect<Heartbeat.Alive.Response>(
344+
timeoutMillis = bot.configuration.heartbeatTimeoutMillis,
345+
retry = 2
346+
)
347+
return null
348+
}
341349
Heartbeat.Alive(bot.client)
342350
.sendAndExpect<Heartbeat.Alive.Response>(
343351
timeoutMillis = bot.configuration.heartbeatTimeoutMillis,

0 commit comments

Comments
 (0)