[Qa-jenkins-scm] [jenkins.debian.net] 02/04: reproducible: common.py: don't query for bugs if that information is already available
Holger Levsen
holger at moszumanska.debian.org
Wed Jul 8 11:51:01 UTC 2015
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 68bf6445731dd3b9d1ed24348f38fffa58dd60fc
Author: Mattia Rizzolo <mattia at mapreri.org>
Date: Wed Jul 8 11:02:40 2015 +0000
reproducible: common.py: don't query for bugs if that information is already available
---
bin/reproducible_common.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index a22e740..9cb81b5 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -498,12 +498,15 @@ def get_bugs():
global conn_udd
if not conn_udd:
conn_udd = start_udd_connection()
+ global bugs
+ if bugs:
+ return bugs
rows = query_udd(query)
log.info("finding out which usertagged bugs have been closed or at least have patches")
packages = {}
- bugs = [str(x[0]) for x in rows]
- bugs_patches = bugs_have_patches(bugs)
+ bugs_nr = [str(x[0]) for x in rows]
+ bugs_patches = bugs_have_patches(bugs_nr)
pkgs = [str(x[1]) for x in rows]
pkgs_real = are_virtual_packages(pkgs)
@@ -569,5 +572,7 @@ def irc_msg(msg):
conn_db = start_db_connection() # the local sqlite3 reproducible db
# get_bugs() is the only user of this, let it initialize the connection itself,
# during it's first call to speed up things when unneeded
+# also "share" the bugs, to avoid collecting them multiple times per run
conn_udd = None
+bugs = None
--
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