The thing is web2py caching logic is different from what bottlenose wants
as it never really returns None, it also never really stores values
directly it calls a function to get a value when it needs one so you need
to make some kind of adapter for it, you were almost there.
I haven't tested it but this should work.
def reader(cache_url):
return cache.ram(cache_url, lambda: None, time_expire=None) # Time
expire can be any value you want here (e.g 3600 so bottlenose writes it
again in an hour)
def writer(cache_url, response_text):
cache.ram(cache_url, lambda: response_text, time_expire=0) # Time
expire needs to be 0 here to make sure it always writes
amazon = bottlenose.Amazon(CacheWriter=writer,
CacheReader=reader, ....)
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.