From: Torsten Werner Date: Thu, 8 Jul 2010 21:27:52 +0000 (+0000) Subject: show-new: reduce DB sessions even more X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=88c7ec31a8f46beeb2209582a99d9b4f234bdd3c;p=dak.git show-new: reduce DB sessions even more Signed-off-by: Torsten Werner --- diff --git a/dak/show_new.py b/dak/show_new.py index cb40a4c9..6d646918 100755 --- a/dak/show_new.py +++ b/dak/show_new.py @@ -172,7 +172,7 @@ def do_pkg(changes_file): u.check_source_against_db(deb_filename, session) u.pkg.changes["suite"] = u.pkg.changes["distribution"] - new = determine_new(u.pkg.changes, files, 0) + new = determine_new(u.pkg.changes, files, 0, session) htmlname = changes["source"] + "_" + changes["version"] + ".html" sources.add(htmlname) diff --git a/daklib/queue.py b/daklib/queue.py index ca3c133e..d3727216 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -91,7 +91,7 @@ def get_type(f, session): # Determine what parts in a .changes are NEW -def determine_new(changes, files, warn=1): +def determine_new(changes, files, warn=1, session = None): """ Determine what parts in a C{changes} file are NEW. @@ -110,8 +110,6 @@ def determine_new(changes, files, warn=1): """ new = {} - session = DBConn().session() - # Build up a list of potentially new things for name, f in files.items(): # Skip byhand elements @@ -181,8 +179,6 @@ def determine_new(changes, files, warn=1): if new[pkg].has_key("othercomponents"): print "WARNING: %s already present in %s distribution." % (pkg, new[pkg]["othercomponents"]) - session.close() - return new ################################################################################