mirror of
https://github.com/wassname/cachier.git
synced 2026-09-10 11:50:23 +08:00
Update README.rst
This commit is contained in:
@@ -77,6 +77,10 @@ You can set any duration as the shelf life of cached return values of a function
|
||||
@cachier(stale_after=datetime.timedelta(weeks=2))
|
||||
def bar(arg1, arg2):
|
||||
return {'arg1': arg1, 'arg2': arg2}
|
||||
|
||||
Now when a cached value matching the given arguments is found the time of its calculation is checked; if more than ``stale_after`` time has since passed the function will be run again for the same arguments and the new value will be cached and returned.
|
||||
|
||||
This is usefull for lengthy calculation that depend on a dynamic data source.
|
||||
|
||||
Fuzzy Shelf Live
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user