def checkproxypool(wait_time=VALID_CHECK_TIME): #检查原有的代理池 print('Checking pool') tester = ValidityTester() redis=RedisClient() while True: halfcount = int(redis.len() / 2) if halfcount==0: time.sleep(wait_time) continue halfproxies = redis.cget(halfcount) tester.set_raw_proxies(halfproxies) tester.check_some_proxies() time.sleep(wait_time)