[Qa-jenkins-scm] [jenkins.debian.net] 01/05: reproducible: common.py: speed up the import by initializing the udd connection inside get_bugs() (current unique user of udd)
Holger Levsen
holger at moszumanska.debian.org
Wed Apr 22 07:40:21 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 11f08aa7033883916f20e4990ecf7447037bff00
Author: Mattia Rizzolo <mattia at mapreri.org>
Date: Tue Apr 21 22:37:27 2015 +0200
reproducible: common.py: speed up the import by initializing the udd connection inside get_bugs() (current unique user of udd)
---
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 202ea40..75907a4 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
--
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