-
Notifications
You must be signed in to change notification settings - Fork 3
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
Something about Download Timeout #13
Comments
请提供一个代码样例复现你的问题。 |
为验证是否为recording长度导致,可以在定义query时加上以下三个参数重新尝试
|
谢谢!我先再尝试一下! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
您好,我在下载的时候发现一些音频文件在某些情况下(可能是网络的问题)下载时间过长,而且进度条一直停滞不前,有时甚至停滞十分钟到二十分钟不等,有时候我只能手动中断使之进入下一个循环。
后来我在stackoverflow上找到一个非常非常简单的解决方案,就是在执行请求的代码前加入
socket.setdefaulttimeout(30)
,控制socket打开的时间,比如此处我设置为30秒。同时我加入一些其他设置,让代码在触发
socket.timeout
错误后,可以将对应的请求参数记录下来,并继续执行下一个循环。由此可以避免下载停滞的问题。当我完成所有循环以后,会将socket打开的时间再增加(比如增加到120秒),对先前记录下的请求参数再次执行。由此循环多次以将所有参数请求完毕。希望能帮助到大家。
Hello, when I was downloading, I found that the download time of some audio files was too long under certain circumstances (may be a problem with the network), and the progress bar has been stagnant, sometimes even for ten to twenty minutes, there are Sometimes I can only manually interrupt it to enter the next cycle.
Later, I found a very, very simple solution on stackoverflow, which is to add
socket.setdefaulttimeout(30)
before executing the requested code to control the opening time of the socket. For example, I set it to 30 seconds here.At the same time, I added some other settings so that after the code triggers the
socket.timeout
error, it can record the corresponding request parameters and continue to execute the next loop. This can avoid the problem of download stagnation. When I finish all the loops, I will increase the socket opening time (for example, to 120 seconds), and execute again on the previously recorded request parameters. Loop for multiple times to complete the request for all parameters.I Hope that can help everyone.
The text was updated successfully, but these errors were encountered: