summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-07-08 11:02:40 +0000
committerHolger Levsen <holger@layer-acht.org>2015-07-08 13:47:44 +0200
commit68bf6445731dd3b9d1ed24348f38fffa58dd60fc (patch)
tree2cf2116ca1ef7cfdc35feece46cf2acb7d3754cf
parent9ae92629c769cea075dcdb5be6769bf23470423f (diff)
downloadjenkins.debian.net-68bf6445731dd3b9d1ed24348f38fffa58dd60fc.tar.xz
reproducible: common.py: don't query for bugs if that information is already available
-rwxr-xr-xbin/reproducible_common.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index a22e7402..9cb81b53 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