# HG changeset patch # User Marcin Kuzminski # Date 2019-10-18 07:44:24 # Node ID b717c94844d6e6485a89bcc7b62c77c25f57e93e # Parent 823cbf311eaac23b706dc8d79faf08712f82b684 caches: added method for flush cache for last commit - small logging update diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -2298,6 +2298,10 @@ class Repository(Base, BaseModel): return self.get_commit() return commit + def flush_commit_cache(self): + self.update_commit_cache(cs_cache={'raw_id':'0'}) + self.update_commit_cache() + def update_commit_cache(self, cs_cache=None, config=None): """ Update cache of last commit for repository, keys should be:: @@ -2351,7 +2355,7 @@ class Repository(Base, BaseModel): Session().add(self) Session().commit() - log.debug('updated repo %s with new commit cache %s', + log.debug('updated repo `%s` with new commit cache %s', self.repo_name, cs_cache) else: cs_cache = self.changeset_cache @@ -2868,7 +2872,7 @@ class RepoGroup(Base, BaseModel): Session().add(repo_group) Session().commit() - log.debug('updated repo group %s with new commit cache %s', + log.debug('updated repo group `%s` with new commit cache %s', repo_group.group_name, latest_repo_cs_cache) def permissions(self, with_admins=True, with_owner=True,