]> git.decadent.org.uk Git - dak.git/commitdiff
show-new: open a new session for every source package
authorTorsten Werner <twerner@dhcp-101.dfw1.kickstart.lan>
Mon, 5 Jul 2010 20:44:11 +0000 (20:44 +0000)
committerTorsten Werner <twerner@dhcp-101.dfw1.kickstart.lan>
Mon, 5 Jul 2010 20:44:11 +0000 (20:44 +0000)
Signed-off-by: Torsten Werner <twerner@debian.org>
dak/show_new.py

index 5c7e8864263f72928930af51bf64af2a686dc924..9e216c5e2033f1b59f4c14b3dc249b2a493527a7 100755 (executable)
@@ -143,7 +143,8 @@ def html_footer():
 ################################################################################
 
 
-def do_pkg(changes_file, session):
+def do_pkg(changes_file):
+    session = DBConn().session()
     u = Upload()
     u.pkg.changes_file = changes_file
     (u.pkg.changes["fingerprint"], rejects) = utils.check_signature(changes_file)
@@ -194,6 +195,7 @@ def do_pkg(changes_file, session):
         if sys.stdout != stdout_fd:
             sys.stdout.close()
             sys.stdout = stdout_fd
+    session.close()
 
 ################################################################################
 
@@ -245,7 +247,7 @@ def main():
         if not changes_file:
             continue
         print "\n" + changes_file
-        do_pkg (changes_file, session)
+        do_pkg (changes_file)
 
     files = set(os.listdir(cnf["Show-New::HTMLPath"]))
     to_delete = filter(lambda x: x.endswith(".html"), files.difference(sources))