Mercurial > kallithea
changeset 4326:fb3b45acd172
repository: don't update changeset cache so much - not in BaseRepoController and only when tip raw_id changed
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 18 Jul 2014 18:44:54 +0200 |
parents | cdb2b5ac95e6 |
children | 64d6e8e298a4 |
files | kallithea/lib/base.py kallithea/model/db.py |
diffstat | 2 files changed, 3 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/lib/base.py Tue Dec 10 19:30:37 2013 +0100 +++ b/kallithea/lib/base.py Fri Jul 18 18:44:54 2014 +0200 @@ -411,9 +411,6 @@ redirect(url('home')) - # update last change according to VCS data - dbr.update_changeset_cache(dbr.get_changeset()) - # some globals counter for menu c.repository_followers = self.scm_model.get_followers(dbr) c.repository_forks = self.scm_model.get_forks(dbr)
--- a/kallithea/model/db.py Tue Dec 10 19:30:37 2013 +0100 +++ b/kallithea/model/db.py Fri Jul 18 18:44:54 2014 +0200 @@ -1321,7 +1321,7 @@ if isinstance(cs_cache, BaseChangeset): cs_cache = cs_cache.__json__() - if (cs_cache != self.changeset_cache or not self.changeset_cache): + if (not self.changeset_cache or cs_cache['raw_id'] != self.changeset_cache['raw_id']): _default = datetime.datetime.fromtimestamp(0) last_change = cs_cache.get('date') or _default log.debug('updated repo %s with new cs cache %s' @@ -1331,8 +1331,8 @@ Session().add(self) Session().commit() else: - log.debug('Skipping repo:%s already with latest changes' - % self.repo_name) + log.debug('changeset_cache for %s already up to date with %s' + % (self.repo_name, cs_cache['raw_id'])) @property def tip(self):