@@ -77,18 +77,18 @@ async def consumer(self):
77
77
while True :
78
78
await asyncio .sleep (0.1 )
79
79
i = 0
80
- async with aiohttp .ClientSession (
81
- connector = ProxyConnector (remote_resolve = False ),
82
- request_class = ProxyClientRequest
83
- ) as aiohttp_proxy_check_session :
84
- while not self .queue .empty () and i <= settings .CONCURRENT_TASKS_COUNT :
85
- proxy_data = self .queue .get_nowait ()
86
- tasks .append (self .process_proxy (* proxy_data , aiohttp_proxy_check_session ))
87
- self .queue .task_done ()
88
-
89
- if tasks :
90
- await asyncio .wait (tasks )
91
- tasks .clear ()
80
+ # async with aiohttp.ClientSession(
81
+ # connector=ProxyConnector(remote_resolve=False),
82
+ # request_class=ProxyClientRequest
83
+ # ) as aiohttp_proxy_check_session:
84
+ while not self .queue .empty () and i <= settings .CONCURRENT_TASKS_COUNT :
85
+ proxy_data = self .queue .get_nowait ()
86
+ tasks .append (self .process_proxy (* proxy_data ))
87
+ self .queue .task_done ()
88
+
89
+ if tasks :
90
+ await asyncio .wait (tasks )
91
+ tasks .clear ()
92
92
93
93
async def producer (self ):
94
94
while True :
@@ -200,7 +200,7 @@ async def process_raw_proxies(self, proxies, collector_id):
200
200
))
201
201
202
202
async def process_proxy (self , raw_protocol : int , auth_data : str , domain : str , port : int , collector_id : int ,
203
- aiohttp_proxy_check_session ):
203
+ aiohttp_proxy_check_session = None ):
204
204
self .logger .debug ("start processing proxy {}://{}@{}:{} with collector id {}" .format (
205
205
raw_protocol , auth_data , domain , port , collector_id ))
206
206
@@ -253,6 +253,8 @@ async def process_proxy(self, raw_protocol: int, auth_data: str, domain: str, po
253
253
session .rollback ()
254
254
self .logger .error ("Error during processing proxy" )
255
255
self .logger .exception (ex )
256
+ print ("Exception proxy_url = {}" .format (proxy_url ))
257
+ exit (1 )
256
258
257
259
@staticmethod
258
260
def create_or_update_proxy (raw_protocol : Proxy .PROTOCOLS , auth_data , domain , port ,
0 commit comments