##// END OF EJS Templates
last-update: use smarter calculation that picks the newer dates first...
marcink -
r2812:24d6ff87 default
parent child Browse files
Show More
@@ -2231,8 +2231,13 b' class Repository(Base, BaseModel):'
2231
2231
2232 # check if we have maybe already latest cached revision
2232 # check if we have maybe already latest cached revision
2233 if is_outdated(cs_cache) or not self.changeset_cache:
2233 if is_outdated(cs_cache) or not self.changeset_cache:
2234 _default = datetime.datetime.fromtimestamp(0)
2234 _default = datetime.datetime.utcnow()
2235 last_change = cs_cache.get('date') or _default
2235 last_change = cs_cache.get('date') or _default
2236 if self.updated_on and self.updated_on > last_change:
2237 # we check if last update is newer than the new value
2238 # if yes, we use the current timestamp instead. Imagine you get
2239 # old commit pushed 1y ago, we'd set last update 1y to ago.
2240 last_change = _default
2236 log.debug('updated repo %s with new cs cache %s',
2241 log.debug('updated repo %s with new cs cache %s',
2237 self.repo_name, cs_cache)
2242 self.repo_name, cs_cache)
2238 self.updated_on = last_change
2243 self.updated_on = last_change
General Comments 0
You need to be logged in to leave comments. Login now