mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-24 06:50:08 +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")
|
bot.logger.info("Connection dropped or lost by server, retrying login")
|
||||||
|
|
||||||
tryNTimesOrException(configuration.reconnectionRetryTimes) {
|
tryNTimesOrException(configuration.reconnectionRetryTimes) { tryCount ->
|
||||||
|
if (tryCount != 0) {
|
||||||
delay(configuration.reconnectPeriodMillis)
|
delay(configuration.reconnectPeriodMillis)
|
||||||
|
}
|
||||||
network.relogin()
|
network.relogin()
|
||||||
logger.info("Reconnected successfully")
|
logger.info("Reconnected successfully")
|
||||||
return@subscribeAlways
|
return@subscribeAlways
|
||||||
|
Loading…
Reference in New Issue
Block a user