Retry for login

This commit is contained in:
Him188 2020-01-30 20:36:47 +08:00
parent 8bdfad961f
commit 35ac68e0cd

View File

@ -99,7 +99,11 @@ abstract class BotImpl<N : BotNetworkHandler> constructor(
_network = createNetworkHandler(this.coroutineContext)
while (true){
_network.login()
try {
return _network.login()
} catch (e: Exception){
e.logStacktrace("Exception when login")
}
delay(3000)
logger.warning("Login failed. Retrying in 3s...")
}