]> git.decadent.org.uk Git - dak.git/commitdiff
Fix session handling in queue-report.
authorTorsten Werner <twerner@debian.org>
Sat, 19 Feb 2011 23:46:28 +0000 (00:46 +0100)
committerTorsten Werner <twerner@debian.org>
Sat, 19 Feb 2011 23:46:28 +0000 (00:46 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
dak/queue_report.py

index d3777a273971cd67e36314c907dee404779a5760..19673d5593a0d313de1d97598d0236c6b4cffd9f 100755 (executable)
@@ -358,7 +358,6 @@ RRA:MAX:0.5:288:795
 ############################################################
 
 def process_changes_files(changes_files, type, log, rrd_dir):
-    #session = DBConn().session()
     msg = ""
     cache = {}
     # Read in all the .changes files
@@ -431,7 +430,9 @@ def process_changes_files(changes_files, type, log, rrd_dir):
         for j in i[1]["list"]:
             changesbase = os.path.basename(j["filename"])
             try:
+                session = DBConn().session()
                 dbc = session.query(DBChange).filter_by(changesname=changesbase).one()
+                session.close()
             except Exception, e:
                 print "Can't find changes file in NEW for %s (%s)" % (changesbase, e)
                 dbc = None