a new value for expiretime is only taken into account when the cache is
actually populated. You should be sending the expiretime to the cache at
the point at which you send a creation function or anytime you set the
value. if you retrieve a value and it pulls a preexisting cache value,
the expiretime is stored in the cache itself and that is what's used.
the usage you're doing is removed since it no longer keeps track of expire
time in memory - this does not scale for a large number of keys nor does
it work properly across server instances.
joeformd wrote:
>
> Hi,
>
> Not sure if some usage has changed, but when I upgraded to 1.1, my
> expiretime parameter in cache.get_value() doesnt seem to have any
> effect - new caches are made, but don't seem to be replaced when the
> time is up. If I roll back to 0.9 it works fine.
>
> Code:
>
> request = web.ctx.environ['PATH_INFO'] + web.ctx.environ
> ['QUERY_STRING']
>
> cache = web.ctx.environ['beaker.cache'].get_cache('lif_public')
>
> try:
>
> response = cache.get_value(request, expiretime=3*60)
>
> except:
>
> cache.set_value(request, func(self, *args, **kwargs))
> response = cache.get_value(request)
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---