diff options
author | Mart Raudsepp <leio@gentoo.org> | 2016-12-07 04:08:03 +0200 |
---|---|---|
committer | Mart Raudsepp <leio@gentoo.org> | 2016-12-07 04:08:03 +0200 |
commit | 32483c9459bcfc4f7e3848b3c0e3dc6c1c41829d (patch) | |
tree | b8479087b915f64b10c30b807d1477efe44c7579 | |
parent | sync: Add package description and maintainers sync (diff) | |
download | grumpy-32483c9459bcfc4f7e3848b3c0e3dc6c1c41829d.tar.gz grumpy-32483c9459bcfc4f7e3848b3c0e3dc6c1c41829d.tar.bz2 grumpy-32483c9459bcfc4f7e3848b3c0e3dc6c1c41829d.zip |
sync: Order package details syncing based on how old the last sync was
This way if we got stuck and re-run much later (or it has exceeded the buffer
time constant), we'll at least sync the oldest ones first, so we always end
up being less out of date with the oldest sync ts.
-rw-r--r-- | backend/lib/sync.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/lib/sync.py b/backend/lib/sync.py index 567da2d..0250fba 100644 --- a/backend/lib/sync.py +++ b/backend/lib/sync.py @@ -154,7 +154,7 @@ def sync_versions(): for maintainer in Maintainer.query.all(): existing_maintainers[maintainer.email] = maintainer - for package in Package.query.filter(Package.last_sync_ts < ts).all(): + for package in Package.query.filter(Package.last_sync_ts < ts).order_by(Package.last_sync_ts).all(): cnt += 1 data = http_session.get(pkg_url_base + "packages/" + package.full_name + ".json") if not data: |