[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible debian: speed up _scheduler.py significantly
Holger Levsen
holger at layer-acht.org
Tue Oct 25 17:16:05 UTC 2016
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit 573b7786a828268d6eb2c26ceb74814a7041cf64
Author: Valerie R Young <spectranaut at riseup.net>
Date: Tue Oct 25 13:06:06 2016 -0400
reproducible debian: speed up _scheduler.py significantly
This fix has to important parts: (1) changing a list to set for
fast looks ups, and (2) changing a slqalchemy RowProxy object to a
tuple for fast comparisons.
Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
bin/reproducible_scheduler.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/reproducible_scheduler.py b/bin/reproducible_scheduler.py
index b279e02..bb0659e 100755
--- a/bin/reproducible_scheduler.py
+++ b/bin/reproducible_scheduler.py
@@ -239,7 +239,7 @@ def update_sources_db(suite, arch, sources):
# get the current packages in the database
query = "SELECT name, version, suite, architecture FROM sources " + \
"WHERE suite='{}' AND architecture='{}'".format(suite, arch)
- cur_pkgs = query_db(query)
+ cur_pkgs = set([(p.name, p.version, p.suite, p.architecture) for p in query_db(query)])
pkgs_to_add = []
updated_pkgs = []
different_pkgs = [x for x in new_pkgs if x not in cur_pkgs]
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list