Skip to content

Commit

Permalink
Merge pull request #1817 from jcugat/timeout-timernoop
Browse files Browse the repository at this point in the history
Avoid creating TimerContext when there is no timeout
  • Loading branch information
fafhrd91 authored Apr 16, 2017
2 parents 0427370 + 3e48c62 commit 2248325
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Changes

- Added `iter_chunks` to response.content object. #1805

- Avoid creating TimerContext when there is no timeout to allow compatibility with Tornado. #1817 #1180


2.0.7 (2017-04-12)
------------------
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Jesus Cea
Jinkyu Yi
Joel Watts
Joongi Kim
Josep Cugat
Julia Tsemusheva
Julien Duponchelle
Junjie Tao
Expand Down
7 changes: 5 additions & 2 deletions aiohttp/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,11 @@ def start(self):
return self._loop.call_at(at, self.__call__)

def timer(self):
timer = TimerContext(self._loop)
self.register(timer.timeout)
if self._timeout is not None and self._timeout > 0:
timer = TimerContext(self._loop)
self.register(timer.timeout)
else:
timer = TimerNoop()
return timer

def __call__(self):
Expand Down

0 comments on commit 2248325

Please sign in to comment.