Mercurial > kallithea
changeset 5766:041e8a5a2246
db: inline repo __get_instance to scm_instance_no_cache
Having two names for the same thing just made it look even more complicated
than it is.
There _should_ not be any reason for calling scm_instance_no_cache directly
anywhere ... but for now that is how it is.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 14 Mar 2016 16:17:46 +0100 |
parents | c4ec645b42ce |
children | b76cdfccb5b8 |
files | kallithea/model/db.py |
diffstat | 1 files changed, 2 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/model/db.py Mon Mar 14 16:17:46 2016 +0100 +++ b/kallithea/model/db.py Mon Mar 14 16:17:46 2016 +0100 @@ -1437,9 +1437,6 @@ """ CacheInvalidation.set_invalidate(self.repo_name) - def scm_instance_no_cache(self): - return self.__get_instance() - @property def scm_instance(self): import kallithea @@ -1452,7 +1449,7 @@ @cache_region('long_term') def _c(repo_name): # repo_name is just for the cache key log.debug('Creating new %s scm_instance and populating cache', repo_name) - return self.__get_instance() + return self.scm_instance_no_cache() rn = self.repo_name valid = CacheInvalidation.test_and_set_valid(rn, None, valid_cache_keys=valid_cache_keys) @@ -1463,7 +1460,7 @@ log.debug('Trying to get scm_instance of %s from cache', rn) return _c(rn) - def __get_instance(self): + def scm_instance_no_cache(self): repo_full_path = safe_str(self.repo_full_path) alias = get_scm(repo_full_path)[0] log.debug('Creating instance of %s repository from %s',