##// END OF EJS Templates
repr of cache inv object show also now cache_active + some better logging
marcink -
r3686:f18801f8 beta
parent child Browse files
Show More
@@ -1167,7 +1167,6 b' class Repository(Base, BaseModel):'
1167 def _c(repo_name):
1167 def _c(repo_name):
1168 return self.__get_instance()
1168 return self.__get_instance()
1169 rn = self.repo_name
1169 rn = self.repo_name
1170 log.debug('Getting cached instance of repo')
1171
1170
1172 if cache_map:
1171 if cache_map:
1173 # get using prefilled cache_map
1172 # get using prefilled cache_map
@@ -1181,8 +1180,11 b' class Repository(Base, BaseModel):'
1181
1180
1182 if invalidate_repo is not None:
1181 if invalidate_repo is not None:
1183 region_invalidate(_c, None, rn)
1182 region_invalidate(_c, None, rn)
1183 log.debug('Cache for %s invalidated, getting new object' % (rn))
1184 # update our cache
1184 # update our cache
1185 CacheInvalidation.set_valid(invalidate_repo.cache_key)
1185 CacheInvalidation.set_valid(invalidate_repo.cache_key)
1186 else:
1187 log.debug('Getting obj for %s from cache' % (rn))
1186 return _c(rn)
1188 return _c(rn)
1187
1189
1188 def __get_instance(self):
1190 def __get_instance(self):
@@ -1648,8 +1650,8 b' class CacheInvalidation(Base, BaseModel)'
1648 self.cache_active = False
1650 self.cache_active = False
1649
1651
1650 def __unicode__(self):
1652 def __unicode__(self):
1651 return u"<%s('%s:%s')>" % (self.__class__.__name__,
1653 return u"<%s('%s:%s[%s]')>" % (self.__class__.__name__,
1652 self.cache_id, self.cache_key)
1654 self.cache_id, self.cache_key, self.cache_active)
1653
1655
1654 def get_prefix(self):
1656 def get_prefix(self):
1655 """
1657 """
General Comments 0
You need to be logged in to leave comments. Login now