diff --git a/repomirror/fetcher/_base.py b/repomirror/fetcher/_base.py index 7f8ac65..4b84696 100644 --- a/repomirror/fetcher/_base.py +++ b/repomirror/fetcher/_base.py @@ -31,7 +31,7 @@ class BaseFetcher(object): else: tstmp = datetime.datetime.strptime(tstmp_raw, v.fmt) self.timestamps[k] = tstmp - _logger.debug('Updated timestamps: {0}'.format(self.timestamps)) + _logger.debug('Updated upstream timestamps: {0}'.format(self.timestamps)) return(None) def fetch_content(self, path): diff --git a/repomirror/sync.py b/repomirror/sync.py index e45c392..c6080d6 100644 --- a/repomirror/sync.py +++ b/repomirror/sync.py @@ -229,23 +229,30 @@ class Distro(object): if v: tstmp = v.read() self.timestamps[k] = tstmp - _logger.debug('Updated timestamps: {0}'.format(self.timestamps)) + _logger.debug('Updated local timestamps: {0}'.format(self.timestamps)) local_checks = sorted([i for i in self.timestamps.values() if i]) + if local_checks: + _logger.debug('Local timestamps: {0}'.format(', '.join([str(t) for t in local_checks]))) for u in self.upstreams: if not u.available: continue u.fetcher.check() remote_checks = sorted([i for i in u.fetcher.timestamps.values() if i]) + if remote_checks: + _logger.debug('Remote timestamps for {0}: {1}'.format(u.domain, ', '.join([str(t) + for t in remote_checks]))) if not any((local_checks, remote_checks)) or not remote_checks: u.has_new = True else: update = u.fetcher.timestamps.get('update') sync = u.fetcher.timestamps.get('sync') if update: - if local_checks and local_checks[-1] < update: + if local_checks and (local_checks[-1] < update): u.has_new = True elif not local_checks: u.has_new = True + else: + u.has_new = True if sync: td = datetime.datetime.utcnow() - sync if td.days > constants.DAYS_WARN: