[+]优化:1.Generator改用queue 2.兼容Py2 #1
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1. Generator改用queue
一开始我是用py2跑的,我测试的是

https://theora.org/.svn
,下载svn版本大于1.7的时候有问题。并不能成功下载完所有文件,只是下了一个
wc.db
数据库文件看了一下线程的运行图,很快就结束了
查了下资料,参考链接: multithreading: Why aren't generators thread-safe? What happens when it is shared among threads?
可能是因为
Generator
是线程不安全的导致的,然后我就改成thread-safe
的queue
来存放待下载的文件。您不妨可以测测该站点,或者google hack一下:
Index of /.svn
找到别的svn版本大于1.7的站点2.兼容py2
因为我用py2多呀.hhhh