We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd720e1 commit 603e65eCopy full SHA for 603e65e
proxypool/setting.py
@@ -35,3 +35,6 @@
35
TESTER_ENABLED = True
36
GETTER_ENABLED = True
37
API_ENABLED = True
38
+
39
+# 最大批测试量
40
+BATCH_TEST_SIZE = 100
proxypool/tester.py
@@ -47,9 +47,8 @@ def run(self):
47
try:
48
proxies = self.redis.all()
49
loop = asyncio.get_event_loop()
50
- batch_size = 100
51
- for i in range(0, len(proxies), batch_size):
52
- test_proxies = proxies[i:i + batch_size]
+ for i in range(0, len(proxies), BATCH_TEST_SIZE):
+ test_proxies = proxies[i:i + BATCH_TEST_SIZE]
53
tasks = [self.test_single_proxy(proxy) for proxy in test_proxies]
54
loop.run_until_complete(asyncio.wait(tasks))
55
time.sleep(5)
0 commit comments