##// END OF EJS Templates
caches: use delete_multi for clearing out cache keys....
marcink -
r2888:fc338c66 default
parent child Browse files
Show More
@@ -102,6 +102,5 b' def get_or_create_region(region_name, re'
102 102 def clear_cache_namespace(cache_region, cache_namespace_uid):
103 103 region = get_or_create_region(cache_region, cache_namespace_uid)
104 104 cache_keys = region.backend.list_keys(prefix=cache_namespace_uid)
105 for k in cache_keys:
106 region.delete(k)
105 region.delete_multi(cache_keys)
107 106 return len(cache_keys)
@@ -74,8 +74,7 b' class TestCaches(object):'
74 74 def test_store_value_in_cache(self):
75 75 cache_region = rc_cache.get_or_create_region('cache_perms')
76 76 # make sure we empty the cache now
77 for key in cache_region.backend.list_keys():
78 cache_region.delete(key)
77 cache_region.delete_multi(cache_region.backend.list_keys())
79 78
80 79 assert cache_region.backend.list_keys() == []
81 80
General Comments 0
You need to be logged in to leave comments. Login now