From: Mark Hymers Date: Sun, 15 Nov 2009 19:03:46 +0000 (+0000) Subject: clean the pending table even when we quit X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cafe517c049fffc664411df962c96da99c66ea5;p=dak clean the pending table even when we quit Signed-off-by: Mark Hymers --- 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() ###############################################################################