summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrent s <bts@square-r00t.net>2020-06-24 01:15:56 -0400
committerbrent s <bts@square-r00t.net>2020-06-24 01:15:56 -0400
commit2ff334f2201c6877fa2354273ab074321b06d4e8 (patch)
tree4cade18c44c8fa2c3758b13e52e587363c358f87
parentc8bf61ea9831347eaab8c524d80fe68ca4b97beb (diff)
downloadRepoMirror-2ff334f2201c6877fa2354273ab074321b06d4e8.tar.xz
still not syncing properly...
-rw-r--r--repomirror/fetcher/_base.py2
-rw-r--r--repomirror/sync.py11
2 files changed, 10 insertions, 3 deletions
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: