From 0cafe517c049fffc664411df962c96da99c66ea5 Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Sun, 15 Nov 2009 19:03:46 +0000 Subject: [PATCH] clean the pending table even when we quit Signed-off-by: Mark Hymers --- dak/process_upload.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/dak/process_upload.py b/dak/process_upload.py index 33fff0dc..10e81f6f 100755 --- a/dak/process_upload.py +++ b/dak/process_upload.py @@ -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() ############################################################################### -- 2.39.5