Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sphinx builds to show API reference #390

Closed
smlbiobot opened this issue Mar 21, 2018 · 4 comments
Closed

Fix sphinx builds to show API reference #390

smlbiobot opened this issue Mar 21, 2018 · 4 comments

Comments

@smlbiobot
Copy link

When I use the @cache decorator, the key needs to be set on the decorator, but I have many caches where I would like to set a ttl of 60 seconds but are in fact database queries. How would I go about setting those keys — is ttl an option for cache.set ? And if it is, how do I know when it the data is stale? Does it auto-delete itself such that when I call cache.get it will return None?

Thanks in advance!

@argaen
Copy link
Member

argaen commented Mar 21, 2018

  1. Yes, you can set ttl in the set operation
  2. Yes, it gets removed automatically after the ttl expires and yes it will return None then

@argaen argaen closed this as completed Mar 21, 2018
@smlbiobot
Copy link
Author

ah alright — thanks!

@smlbiobot
Copy link
Author

Btw— just wish to add that it would be great if the docs http://aiocache.readthedocs.io/en/latest/index.html contains all the docs from your docstring — right now I find myself reading the source to look at available arguments.

@argaen
Copy link
Member

argaen commented Mar 23, 2018

Oh, apparently sphinx build is not working properly. Will fix that. Thanks for reporting.

PS: going to reuse this issue to track this

@argaen argaen changed the title How to use @cache decorator with dynamic keys Fix sphinx builds to show API reference Mar 23, 2018
@argaen argaen mentioned this issue Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants