mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-04 02:13:56 +08:00
Increase timeout, close #28
This commit is contained in:
parent
3a8b2dd6d2
commit
8f4313a337
@ -550,9 +550,9 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
|
|||||||
class TimeoutException(override val message: String?) : Exception()
|
class TimeoutException(override val message: String?) : Exception()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送一个包, 并挂起直到接收到指定的返回包或超时(3000ms)
|
* 发送一个包, 挂起协程直到接收到指定的返回包或超时
|
||||||
*/
|
*/
|
||||||
suspend fun <E : Packet> OutgoingPacket.sendAndExpect(timeoutMillis: Long = 3000, retry: Int = 2): E {
|
suspend fun <E : Packet> OutgoingPacket.sendAndExpect(timeoutMillis: Long = 5000, retry: Int = 2): E {
|
||||||
require(timeoutMillis > 100) { "timeoutMillis must > 100" }
|
require(timeoutMillis > 100) { "timeoutMillis must > 100" }
|
||||||
require(retry >= 0) { "retry must >= 0" }
|
require(retry >= 0) { "retry must >= 0" }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user