mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-12 18:50:20 +08:00
Retry for login
This commit is contained in:
parent
8bdfad961f
commit
35ac68e0cd
@ -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...")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user