Skip to content

Commit

Permalink
Merge 116dd19 into 936aa7c
Browse files Browse the repository at this point in the history
  • Loading branch information
vinsec committed Feb 18, 2019
2 parents 936aa7c + 116dd19 commit 19726f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ 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"
- "3.6"
#- "3.7" not supported by travis-ci
services:
- docker
- mongodb
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 19726f7

Please sign in to comment.