diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -446,6 +446,7 @@ def repo2db_mapper(initial_repo_list, re # during starting install all cache keys for all repositories in the # system, this will register all repos and multiple instances key, _prefix, _org_key = CacheInvalidation._get_key(name) + log.debug("Creating cache key for %s instance_id:`%s`" % (name, _prefix)) CacheInvalidation._get_or_create_key(key, _prefix, _org_key, commit=False) sa.commit() removed = [] diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -746,6 +746,16 @@ class Repository(Base, BaseModel): p += self.repo_name.split(Repository.url_sep()) return os.path.join(*p) + @property + def cache_keys(self): + """ + Returns associated cache keys for that repo + """ + return CacheInvalidation.query()\ + .filter(CacheInvalidation.cache_args == self.repo_name)\ + .order_by(CacheInvalidation.cache_key)\ + .all() + def get_new_name(self, repo_name): """ returns new full repository name based on assigned group and new new @@ -1402,6 +1412,13 @@ class CacheInvalidation(Base, BaseModel) return u"<%s('%s:%s')>" % (self.__class__.__name__, self.cache_id, self.cache_key) + @property + def prefix(self): + _split = self.cache_key.split(self.cache_args, 1) + if _split and len(_split) == 2: + return _split[0] + return '' + @classmethod def clear_cache(cls): cls.query().delete() diff --git a/rhodecode/templates/admin/repos/repo_edit.html b/rhodecode/templates/admin/repos/repo_edit.html --- a/rhodecode/templates/admin/repos/repo_edit.html +++ b/rhodecode/templates/admin/repos/repo_edit.html @@ -188,6 +188,20 @@