diff rhodecode/model/scm.py @ 3772:910ad1ffee99 beta

invalidation: merge .invalidate and .set_valid as .test_and_set_valid This simplifies the internal API and avoids leaking CacheInvalidation instances and cache keys.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 03 Apr 2013 15:56:12 +0200
parents 12ca667b69b6
children 00e2c162d8bc
line wrap: on
line diff
--- a/rhodecode/model/scm.py	Sun Apr 21 06:10:08 2013 +0200
+++ b/rhodecode/model/scm.py	Wed Apr 03 15:56:12 2013 +0200
@@ -97,12 +97,12 @@
         return '<%s (%s)>' % (self.__class__.__name__, self.__len__())
 
     def __iter__(self):
-        # pre-propagated cache_map to save executing select statements
+        # pre-propagated valid_cache_keys to save executing select statements
         # for each repo
-        cache_map = CacheInvalidation.get_cache_map()
+        valid_cache_keys = CacheInvalidation.get_valid_cache_keys()
 
         for dbr in self.db_repo_list:
-            scmr = dbr.scm_instance_cached(cache_map)
+            scmr = dbr.scm_instance_cached(valid_cache_keys)
             # check permission at this level
             if not HasRepoPermissionAny(
                 *self.perm_set)(dbr.repo_name, 'get repo check'):