Fix login retry

This commit is contained in:
Him188 2020-02-19 12:16:28 +08:00
parent 4f7b266e03
commit c937511412

View File

@ -94,8 +94,10 @@ abstract class BotImpl<N : BotNetworkHandler> constructor(
}
bot.logger.info("Connection dropped or lost by server, retrying login")
tryNTimesOrException(configuration.reconnectionRetryTimes) {
delay(configuration.reconnectPeriodMillis)
tryNTimesOrException(configuration.reconnectionRetryTimes) { tryCount ->
if (tryCount != 0) {
delay(configuration.reconnectPeriodMillis)
}
network.relogin()
logger.info("Reconnected successfully")
return@subscribeAlways