]> err.no Git - dak/commitdiff
commit more often in clean-suites
authorTorsten Werner <twerner@debian.org>
Wed, 27 Jul 2011 11:05:19 +0000 (13:05 +0200)
committerTorsten Werner <twerner@debian.org>
Wed, 27 Jul 2011 11:05:19 +0000 (13:05 +0200)
... to avoid database leaks in case of exceptions

Signed-off-by: Torsten Werner <twerner@debian.org>
dak/clean_suites.py

index 5e41d372785a117e44c7ac0393afc085dc410601..b0711acbcc30a506a2b5bfc8efc2c128a52ecd8a 100755 (executable)
@@ -298,13 +298,11 @@ SELECT s.id, f.filename FROM source s, files f
 
             if not Options["No-Action"]:
                 session.delete(pf)
+                session.commit()
 
         else:
             utils.fubar("%s is neither symlink nor file?!" % (filename))
 
-    if not Options["No-Action"]:
-        session.commit()
-
     if count > 0:
         Logger.log(["total", count, utils.size_type(size)])
         print "Cleaned %d files, %s." % (count, utils.size_type(size))