# HG changeset patch # User Mads Kiilerich # Date 2016-03-14 16:17:46 # Node ID 041e8a5a224623fbac238eb8dbff9e3f37f236ef # Parent c4ec645b42ceb39ba19207c44480462c6a7c12a8 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. diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -1437,9 +1437,6 @@ class Repository(Base, BaseModel): """ 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 @@ class Repository(Base, BaseModel): @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 @@ class Repository(Base, BaseModel): 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',