중복된 proxy 들어가지 않도록

This commit is contained in:
mjjo
2017-08-10 11:36:03 +09:00
parent 3d829e55b5
commit 9e51f989fd
2 changed files with 111 additions and 35 deletions

View File

@@ -61,7 +61,8 @@ class TwitterCrawler:
proxy = None
while not proxy:
proxy = self.proxy_handler.get(proxy2.Platform.TWITTER, proxy_key)
time.sleep(1)
if not proxy:
time.sleep(1)
return proxy
@@ -257,7 +258,7 @@ class TwitterCrawler:
test_tw.user_id = 'Awesome_vely'
test_tw.tweet_id = 888704413111435264
test_tw.text = '시작'
test_tw.text = '?œìž‘'
self.insert_content_pool(0, content_qu, test_tw, test_tw)
content_threads = [threading.Thread(target=self.content_proc, args=(proc_id, content_qu, content_result_qu)) for proc_id in range(16)]
@@ -300,7 +301,7 @@ class TwitterCrawler:
start_time = time.time()
# run
worker_count = 4
worker_count = 16
split_config = self.default_config.split()
content_qu = queue.Queue()