changeset 3686:f18801f827da beta

repr of cache inv object show also now cache_active + some better logging
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 05 Apr 2013 13:27:28 +0200
parents 02e1e270bf93
children 8849c07d8c62
files rhodecode/model/db.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/model/db.py	Wed Apr 03 15:56:12 2013 +0200
+++ b/rhodecode/model/db.py	Fri Apr 05 13:27:28 2013 +0200
@@ -1167,7 +1167,6 @@
         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 @@
 
         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 @@
         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):
         """