]> git.decadent.org.uk Git - dak.git/commitdiff
clean the pending table even when we quit
authorMark Hymers <mhy@debian.org>
Sun, 15 Nov 2009 19:03:46 +0000 (19:03 +0000)
committerMark Hymers <mhy@debian.org>
Sun, 15 Nov 2009 19:03:46 +0000 (19:03 +0000)
Signed-off-by: Mark Hymers <mhy@debian.org>
dak/process_upload.py

index 33fff0dc8059af7834b94619b8c402cccc2e31e2..10e81f6f6200c787d113f5e07e5ae0758dc87fa3 100755 (executable)
@@ -196,6 +196,15 @@ def usage (exit_code=0):
 
 ###############################################################################
 
+def byebye():
+    if not Options["No-Action"]:
+        # Clean out the queue files
+        session = DBConn().session()
+        session.execute("DELETE FROM changes_pending_files WHERE id NOT IN (SELECT file_id FROM changes_pending_files_map )")
+        session.commit()
+
+
+
 def action(u, session):
     cnf = Config()
     holding = Holding()
@@ -302,7 +311,7 @@ def action(u, session):
         session.commit()
         u.remove()
     elif answer == 'Q':
-        sys.exit(0)
+        byebye()
 
     session.commit()
 
@@ -482,14 +491,12 @@ def main():
                                                 utils.size_type(int(summarystats.accept_bytes)))
         Logger.log(["total", summarystats.accept_count, summarystats.accept_bytes])
 
-    if not Options["No-Action"]:
-        # Clean out the queue files
-        session = DBConn().session()
-        session.execute("DELETE FROM changes_pending_files WHERE id NOT IN (SELECT file_id FROM changes_pending_files_map )")
-        session.commit()
+    byebye()
 
+    if not Options["No-Action"]:
         if log_urgency:
             UrgencyLog().close()
+
     Logger.close()
 
 ###############################################################################