Commit 35ac68e0 authored by Him188's avatar Him188

Retry for login

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