changeset 7941:496df7eb2bc2

model: use repo.set_invalidate() instead of accesssing CacheInvalidation directly Trying to contain the use of CacheInvalidation ...
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 20 Oct 2019 21:55:40 +0200
parents 108974a187d9
children c809987a2839
files kallithea/model/scm.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/model/scm.py	Sun Oct 20 21:53:34 2019 +0200
+++ b/kallithea/model/scm.py	Sun Oct 20 21:55:40 2019 +0200
@@ -48,7 +48,7 @@
 from kallithea.lib.vcs.exceptions import RepositoryError
 from kallithea.lib.vcs.nodes import FileNode
 from kallithea.lib.vcs.utils.lazy import LazyProperty
-from kallithea.model.db import CacheInvalidation, PullRequest, RepoGroup, Repository, Session, Ui, User, UserFollowing, UserLog
+from kallithea.model.db import PullRequest, RepoGroup, Repository, Session, Ui, User, UserFollowing, UserLog
 
 
 log = logging.getLogger(__name__)
@@ -217,9 +217,9 @@
         :param repo_name: the repo for which caches should be marked invalid
         """
         log.debug("Marking %s as invalidated and update cache", repo_name)
-        CacheInvalidation.set_invalidate(repo_name)
         repo = Repository.get_by_repo_name(repo_name)
         if repo is not None:
+            repo.set_invalidate()
             repo.update_changeset_cache()
 
     def toggle_following_repo(self, follow_repo_id, user_id):