Commit d9c89590 authored by Him188's avatar Him188

Heartbeat timeout retry

parent b7baae57
......@@ -473,7 +473,13 @@ internal class TIMPCBotNetworkHandler internal constructor(coroutineContext: Cor
HeartbeatPacket(bot.qqAccount, sessionKey).sendAndExpect<HeartbeatPacketResponse>()
} == null) {
// retry one time
if (withTimeoutOrNull(configuration.heartbeatTimeoutMillis) {
HeartbeatPacket(bot.qqAccount, sessionKey).sendAndExpect<HeartbeatPacketResponse>()
} == null) {
bot.logger.warning("Heartbeat timed out")
delay(configuration.firstReconnectDelayMillis)
bot.tryReinitializeNetworkHandler(HeartbeatTimeoutException())
return@launch
......@@ -481,6 +487,7 @@ internal class TIMPCBotNetworkHandler internal constructor(coroutineContext: Cor
}
}
}
}
bot.logger.info("Successfully logged in")
loginResult.complete(null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment