浏览代码

update cycle

Germey 8 年之前
父节点
当前提交
86d63133fc
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      proxypool/getter.py
  2. 1 1
      proxypool/scheduler.py

+ 1 - 1
proxypool/getter.py

@@ -22,7 +22,7 @@ class Getter():
     def run(self):
         print('获取器开始执行')
         proxy_count = 0
-        while not self.is_over_threshold():
+        if not self.is_over_threshold():
             for callback_label in range(self.crawler.__CrawlFuncCount__):
                 callback = self.crawler.__CrawlFunc__[callback_label]
                 # 获取代理

+ 1 - 1
proxypool/scheduler.py

@@ -30,9 +30,9 @@ class Scheduler():
         """
         定时获取代理
         """
+        getter = Getter()
         while True:
             print('开始抓取代理')
-            getter = Getter()
             getter.run()
             time.sleep(cycle)