summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-04-21 22:37:27 +0200
committerMattia Rizzolo <mattia@mapreri.org>2015-04-21 22:54:32 +0200
commit11f08aa7033883916f20e4990ecf7447037bff00 (patch)
tree8afdaa1e44f9c4712556f2bf7f698f41dc5eed60 /bin
parentfc7c5b16e8457eaa933cfb9be03ed2f7eca2e3e8 (diff)
downloadjenkins.debian.net-11f08aa7033883916f20e4990ecf7447037bff00.tar.xz
reproducible: common.py: speed up the import by initializing the udd connection inside get_bugs() (current unique user of udd)
Diffstat (limited to 'bin')
-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 202ea40b..75907a40 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -429,6 +429,9 @@ def get_bugs():
)
"""
# returns a list of tuples [(id, source, done)]
+ global conn_udd
+ if not conn_udd:
+ conn_udd = start_udd_connection()
rows = query_udd(query)
log.info("finding out which usertagged bugs have been closed or at least have patches")
packages = {}
@@ -489,6 +492,8 @@ def get_trailing_bug_icon(bug, bugs, package=None):
return html
# init the databases connections
-conn_db = start_db_connection() # the local sqlite3 reproducible db
-conn_udd = start_udd_connection()
+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
+conn_udd = None