Skip to content

Commit

Permalink
[update] 设置失败次数
Browse files Browse the repository at this point in the history
  • Loading branch information
jinghao_wb committed Oct 9, 2017
1 parent 1590076 commit 9e27c23
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Schedule/ProxyCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
from Manager.ProxyManager import ProxyManager
from Util.LogHandler import LogHandler

FAIL_COUNT = 2

class ProxyCheck(ProxyManager, Thread):

class ProxyCheck(ProxyManager, Thread):
def __init__(self):
ProxyManager.__init__(self)
Thread.__init__(self)
Expand All @@ -47,7 +48,7 @@ def run(self):
else:
self.log.info('ProxyCheck: {} validation fail'.format(proxy))
# 验证失败,计数器减1
if counter and int(counter) < -5:
if counter and int(counter) < -FAIL_COUNT:
self.log.info('ProxyCheck: {} fail too many, delete!'.format(proxy))
self.db.delete(proxy)
else:
Expand All @@ -59,4 +60,4 @@ def run(self):

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

0 comments on commit 9e27c23

Please sign in to comment.