Skip to content

Commit

Permalink
Don't use when no timeout is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
argaen committed Feb 13, 2017
1 parent e401e77 commit 2991cca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions aiocache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def unregister(cls, fn):
def timeout(cls, fn):
@functools.wraps(fn)
async def _timeout(self, *args, **kwargs):
if self.timeout == 0:
return await fn(self, *args, **kwargs)
return await asyncio.wait_for(fn(self, *args, **kwargs), self.timeout)

return _timeout
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
# built documents.
#
# The short X.Y version.
version = '0.3.0'
version = '0.3.1'
# The full version, including alpha/beta/rc tags.
release = '0.3.0'
release = '0.3.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="aiocache",
version="0.3.0",
version="0.3.1",
author="Manuel Miranda",
url="https://github.com/argaen/aiocache",
author_email="[email protected]",
Expand Down

0 comments on commit 2991cca

Please sign in to comment.