Changeset - fb3b45acd172
[Not reviewed]
default
0 2 0
Mads Kiilerich - 11 years ago 2014-07-18 18:44:54
madski@unity3d.com
repository: don't update changeset cache so much - not in BaseRepoController and only when tip raw_id changed
2 files changed with 3 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/base.py
Show inline comments
 
@@ -411,9 +411,6 @@ class BaseRepoController(BaseController)
 

	
 
                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)
kallithea/model/db.py
Show inline comments
 
@@ -1321,7 +1321,7 @@ class Repository(Base, BaseModel):
 
        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 @@ class Repository(Base, BaseModel):
 
            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):
0 comments (0 inline, 0 general)