# HG changeset patch # User Marcin Kuzminski # Date 2013-04-05 11:27:28 # Node ID f18801f827da1b6d3789e861ac3d6d54376dd1c1 # Parent 02e1e270bf93ef4bd56f94299ccef0a126155651 repr of cache inv object show also now cache_active + some better logging diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -1167,7 +1167,6 @@ class Repository(Base, BaseModel): def _c(repo_name): return self.__get_instance() rn = self.repo_name - log.debug('Getting cached instance of repo') if cache_map: # get using prefilled cache_map @@ -1181,8 +1180,11 @@ class Repository(Base, BaseModel): if invalidate_repo is not None: region_invalidate(_c, None, rn) + log.debug('Cache for %s invalidated, getting new object' % (rn)) # update our cache CacheInvalidation.set_valid(invalidate_repo.cache_key) + else: + log.debug('Getting obj for %s from cache' % (rn)) return _c(rn) def __get_instance(self): @@ -1648,8 +1650,8 @@ class CacheInvalidation(Base, BaseModel) self.cache_active = False def __unicode__(self): - return u"<%s('%s:%s')>" % (self.__class__.__name__, - self.cache_id, self.cache_key) + return u"<%s('%s:%s[%s]')>" % (self.__class__.__name__, + self.cache_id, self.cache_key, self.cache_active) def get_prefix(self): """