Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用CQ码发图片有概率会导致WebSocket API call timeout #15

Closed
Aobanana-chan opened this issue Jul 27, 2020 · 3 comments
Closed

Comments

@Aobanana-chan
Copy link

用的是yobot源码版,自己加了点搜图功能。使用CQ发送图片很容易出现这个情况。
下面是miraiOK里信息,貌似图片已经上传完成,但是cqhttp-mirai被阻塞了一样。最后图片依旧没发出来。要卡在这里好久等WebSocket API call timeout。期间miraiOK可以接收到qq的信息,yobot要等WebSocket API call timeout异常抛出后,才接收到miraiOK之前接收到的消息。

Send: ImgStore.GroupPicUp
17:35:39 [INFO] [NETWORK] Recv: RequireUpload(fileId=2903055332, uKey=[75, 37, -21, 88, 71, -22, 15, 10, -58, -43, 59, -120, -36, 112, 113, 112, -125, -56, -70, -45, -70, 12, -25, -101, -114, -78, -88, 116, -86, -108, 50, -1, 92, 54, 31, -100, -14, -2, -123, 105, 76, -99, -47, -110, 88, 106, 57, 12, 15, 114, -103, -5, -83, 54, -33, -108, 53, 117, -64, -114, 122, 0, 3, 1, -14, 123, -118, -105, 73, -34, -41, 126, 117, -72, 56, 7, 58, 58, 84, -63, 14, 7, 84, 91, -58, 65, 102, 66, -64, -34, 17, -7, -42, -16, 83, 57, -18, -35, -65, 12, -54, -81, 12, -4, 1, 125, -42, 16, 57, 7, 73, 122, -51, -51, 90, -102, -118, 9, 120, 46, 14, -102, 21, -55, 57, -80, -98, -102])
17:35:39 [INFO] [NETWORK] [Highway] Uploading group image to 203.205.236.76:8080, size=72.46 KiB

请问产生原因以及解决方法

@yyuueexxiinngg
Copy link
Owner

目前给出的log不涉及cqhttp-mirai, 是mirai本身的上传log, 是否网络问题? 阻塞的问题使用send_msg_async尝试下?

@Faultiness
Copy link

发送较大的本地图片同样遇到这个问题。使用的是nonebot中的await session.send(‘[CQ:image,file=...]’)进行的发送。

@Aobanana-chan
Copy link
Author

目前给出的log不涉及cqhttp-mirai, 是mirai本身的上传log, 是否网络问题? 阻塞的问题使用send_msg_async尝试下?

感谢,我在API后面加了async后性能确实高了不少,而且不阻塞了。因为没找到文档,不知道还有异步的API,现在用起来暂时没发现出现WebSocket API call timeout的情况了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants