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

Commit

Permalink
Merge 7aeaddf into 936aa7c
Browse files Browse the repository at this point in the history
  • Loading branch information
vinsec committed Feb 18, 2019
2 parents 936aa7c + 7aeaddf commit af29c08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: python
cache: pip
python:
- "2.7"
- "3.3"
#- "3.3" travis-ci use lxml-4.3.1 which dosen's support python 3.3
- "3.4"
- "3.5"
- "3.6"
Expand Down
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 af29c08

Please sign in to comment.