Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Merge adedf86 into 936aa7c
Browse files Browse the repository at this point in the history
  • Loading branch information
vinsec committed Feb 18, 2019
2 parents 936aa7c + adedf86 commit 9cb0d11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyspider/fetcher/tornado_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ def __init__(self, inqueue, outqueue, poolsize=100, proxy=None, async_mode=True)
self._running = False
self._quit = False
self.proxy = proxy
self.async = async_mode
self.async_mode = async_mode
self.ioloop = tornado.ioloop.IOLoop()

self.robots_txt_cache = {}

# binding io_loop to http_client here
if self.async:
if self.async_mode:
self.http_client = MyCurlAsyncHTTPClient(max_clients=self.poolsize,
io_loop=self.ioloop)
else:
Expand All @@ -114,7 +114,7 @@ def send_result(self, type, task, result):
logger.exception(e)

def fetch(self, task, callback=None):
if self.async:
if self.async_mode:
return self.async_fetch(task, callback)
else:
return self.async_fetch(task, callback).result()
Expand Down

0 comments on commit 9cb0d11

Please sign in to comment.