Changeset - f18801f827da
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-04-05 13:27:28
marcin@python-works.com
repr of cache inv object show also now cache_active + some better logging
1 file changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/db.py
Show inline comments
 
@@ -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):
 
        """
0 comments (0 inline, 0 general)