mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-08 09:10:11 +08:00
Fix login retry
This commit is contained in:
parent
4f7b266e03
commit
c937511412
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user