From: "Mart Raudsepp" <leio@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/grumpy:master commit in: backend/lib/
Date: Wed, 7 Dec 2016 02:53:27 +0000 (UTC) [thread overview]
Message-ID: <1481079168.0522c4ccf0f4ca737572b8164cde6bb9c498ba7f.leio@gentoo> (raw)
commit: 0522c4ccf0f4ca737572b8164cde6bb9c498ba7f
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 7 02:52:48 2016 +0000
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Wed Dec 7 02:52:48 2016 +0000
URL: https://gitweb.gentoo.org/proj/grumpy.git/commit/?id=0522c4cc
sync: Increase the sync delta to 1 hour and print the sync count and oldest TS at start
backend/lib/sync.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/backend/lib/sync.py b/backend/lib/sync.py
index 8c687c6..7ba583d 100644
--- a/backend/lib/sync.py
+++ b/backend/lib/sync.py
@@ -5,7 +5,7 @@ from datetime import datetime
from .. import app, db
from .models import Category, Maintainer, Package, PackageVersion
-SYNC_BUFFER_SECS = 30*60
+SYNC_BUFFER_SECS = 60*60 #1 hour
proj_url = "https://api.gentoo.org/metastructure/projects.xml"
pkg_url_base = "https://packages.gentoo.org/"
http_session = requests.session()
@@ -154,7 +154,10 @@ 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).order_by(Package.last_sync_ts).all():
+ packages_to_sync = Package.query.filter(Package.last_sync_ts < ts).order_by(Package.last_sync_ts).all()
+ print("Going to sync %d packages%s" % (len(packages_to_sync), (" (oldest sync UTC timestamp: %s)" % packages_to_sync[0].last_sync_ts if len(packages_to_sync) else "")))
+
+ for package in packages_to_sync:
cnt += 1
data = http_session.get(pkg_url_base + "packages/" + package.full_name + ".json")
if not data:
next reply other threads:[~2016-12-07 2:54 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 2:53 Mart Raudsepp [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-01-23 0:06 [gentoo-commits] proj/grumpy:master commit in: backend/lib/ Gilles Dartiguelongue
2017-01-22 17:46 Gilles Dartiguelongue
2017-01-22 17:13 Gilles Dartiguelongue
2017-01-22 12:36 Gilles Dartiguelongue
2017-01-22 12:36 Gilles Dartiguelongue
2017-01-22 12:36 Gilles Dartiguelongue
2017-01-22 12:24 Gilles Dartiguelongue
2017-01-22 12:24 Gilles Dartiguelongue
2017-01-22 12:24 Gilles Dartiguelongue
2017-01-22 12:08 Mart Raudsepp
2017-01-22 12:00 Gilles Dartiguelongue
2017-01-22 12:00 Gilles Dartiguelongue
2017-01-22 11:59 Mart Raudsepp
2017-01-22 11:04 Gilles Dartiguelongue
2017-01-22 11:04 Gilles Dartiguelongue
2016-12-07 7:10 Mart Raudsepp
2016-12-07 4:42 Mart Raudsepp
2016-12-07 2:40 Mart Raudsepp
2016-12-07 2:10 Mart Raudsepp
2016-12-07 1:58 Mart Raudsepp
2016-12-07 1:58 Mart Raudsepp
2016-12-07 0:34 Mart Raudsepp
2016-12-05 17:46 Mart Raudsepp
2016-12-04 8:04 Mart Raudsepp
2016-12-04 8:04 Mart Raudsepp
2016-12-04 7:44 Mart Raudsepp
2016-12-04 6:27 Mart Raudsepp
2016-12-04 6:27 Mart Raudsepp
2016-12-04 5:26 Mart Raudsepp
2016-12-04 5:26 Mart Raudsepp
2016-12-04 4:56 Mart Raudsepp
2016-11-11 1:22 Mart Raudsepp
2016-11-10 15:50 Mart Raudsepp
2016-09-24 7:02 Mart Raudsepp
2016-09-07 20:21 Mart Raudsepp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1481079168.0522c4ccf0f4ca737572b8164cde6bb9c498ba7f.leio@gentoo \
--to=leio@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox