Skip to content

Commit

Permalink
[update] fix 272
Browse files Browse the repository at this point in the history
  • Loading branch information
jhao104 committed Jul 10, 2019
1 parent 07f9845 commit 35f43ec
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Schedule/ProxyCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
import sys
from threading import Thread


try:
from Queue import Empty # py3
except:
from queue import Empty # py2

sys.path.append('../')

from Util.utilFunction import validUsefulProxy
Expand All @@ -35,7 +41,10 @@ def __init__(self, queue, item_dict):
def run(self):
self.db.changeTable(self.useful_proxy_queue)
while self.queue.qsize():
proxy = self.queue.get()
try:
proxy = self.queue.get()
except Empty:
break
count = self.item_dict[proxy]
if validUsefulProxy(proxy):
# 验证通过计数器减1
Expand All @@ -53,8 +62,3 @@ def run(self):
self.db.put(proxy, num=int(count) + 1)
self.queue.task_done()


if __name__ == '__main__':
# p = ProxyCheck()
# p.run()
pass

0 comments on commit 35f43ec

Please sign in to comment.