# HG changeset patch # User Marcin Kuzminski # Date 2010-11-29 21:40:54 # Node ID 4c16ed1eb699f08e8b5a66da47ae3c38058b5e48 # Parent 06a98912325c1ada47b5e6d380b534f39b37a3ab fixed bug introduced in latest commit diff --git a/rhodecode/model/scm.py b/rhodecode/model/scm.py --- a/rhodecode/model/scm.py +++ b/rhodecode/model/scm.py @@ -170,19 +170,6 @@ class ScmModel(BaseModel): 'repository.admin')(repo_name, 'get repo check'): return - pre_invalidate = True - if invalidation_list is not None: - pre_invalidate = repo_name in invalidation_list - - if pre_invalidate: - invalidate = self._should_invalidate(repo_name) - - if invalidate: - log.info('invalidating cache for repository %s', repo_name) - region_invalidate(_get_repo, None, repo_name) - self._mark_invalidated(invalidate) - - #====================================================================== # CACHE FUNCTION #====================================================================== @@ -224,6 +211,18 @@ class ScmModel(BaseModel): repo.dbrepo = dbrepo return repo + pre_invalidate = True + if invalidation_list is not None: + pre_invalidate = repo_name in invalidation_list + + if pre_invalidate: + invalidate = self._should_invalidate(repo_name) + + if invalidate: + log.info('invalidating cache for repository %s', repo_name) + region_invalidate(_get_repo, None, repo_name) + self._mark_invalidated(invalidate) + return _get_repo(repo_name)