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

setu之缓存 #1

Open
carpediemtal opened this issue Sep 25, 2020 · 1 comment
Open

setu之缓存 #1

carpediemtal opened this issue Sep 25, 2020 · 1 comment

Comments

@carpediemtal
Copy link

因为网络问题,下载setu很慢,可以这样解决:
1)机器人启动之前,先将一张setu下载到本地(这个步骤可以由一个cache函数来完成)
2)需要发送setu时,直接发送下载好的
3)发送结束后,再调用缓存cache函数下载setu到本地备用

@xiaohuliqibao
Copy link
Owner

图片慢是因为
1.下载速度--从第三方获取图片的时候的,由于个人/服务器网络的问题,会导致一张较大的图片下载到本地会比较慢(这个在本地开发的测试的时候,比较常见)
2.上传速度--上传图片到腾讯服务器的时候,服务器的出口网速太慢了。
现在的处理方案:
事先上传图片腾讯服务器,同时获取到图片的Id(xxxxxx.mirai)保存到数据库。如果要发送图片直接使用ImageId,这样bot会直接从腾讯服务器中发送图片,而不用让图片经过本地服务器。

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

2 participants