Hi Alex, I think this is the commit you are looking 
for 
https://github.com/web2py/web2py/commit/0dbdf8c676547071d608f800f72d7c3d0aa6ebda
Only the first element matching the regex is deleted.
I'd revert that commit, and it'd be nice to add a test to better check that 
issue

Paolo

On Tuesday, December 16, 2014 12:51:38 PM UTC+1, Alex wrote:
>
> seems like this is related to a change in web2py. Until recently I used 
> web2py 2.4.6 and I never had a problem - I just tested it again. In 2.4.6 
> the original regex works. After I upgraded to 2.9.11 the regex doesn't work 
> anymore.
>
> Am Dienstag, 16. Dezember 2014 12:04:18 UTC+1 schrieb Alex:
>>
>> That would make sense. But it's still the same result. I've changed my 
>> cache keys to avoid dots and only use underscore instead:
>>
>> adminsetting_limits
>>
>> and now I can delete the cached values without any problems:
>>
>> cache.ram.clear(regex=r'adminsetting.*')
>>
>>
>> I still don't fully understand why the original regex doesn't work but at 
>> least it's not an issue anymore.
>> Am Dienstag, 16. Dezember 2014 02:51:07 UTC+1 schrieb Anthony:
>>>
>>> How about:
>>>
>>> cache.ram.clear(regex=r'admin\.setting.*')
>>>
>>> Anthony
>>>
>>> On Monday, December 15, 2014 6:22:38 PM UTC-5, Alex wrote:
>>>>
>>>> I've got a function which returns a dict with some values. the function 
>>>> has this decorator:
>>>>
>>>> @cache('admin.setting.limits', 3600, cache.ram)
>>>>
>>>> def get_limits():
>>>> ..
>>>>
>>>>
>>>> This works fine and the values are used from cache. When I change those 
>>>> settings I want to clear the cache so I'm doing this:
>>>>
>>>> cache.ram.clear(regex='admin\.setting.*')
>>>>
>>>> When I call my function again the cached values are still used. Am I 
>>>> doing something wrong here? Any ideas?
>>>>
>>>>
>>>> regards,
>>>>
>>>> Alex
>>>>
>>>

-- 
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.

Reply via email to