提交 88c7ec31 编写于 作者: T Torsten Werner

show-new: reduce DB sessions even more

Signed-off-by: NTorsten Werner <twerner@debian.org>
上级 0990d4c8
......@@ -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)
......
......@@ -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
################################################################################
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册