From 2c2df242e51ecd09e2588a21629cd35d4fc57893 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sun, 19 May 2024 20:36:20 +1200 Subject: [PATCH] lxmf messages in outbound or sending state should be marked as failed when app starts as they are no longer being processed --- web.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web.py b/web.py index 1b41d7a..4d55446 100644 --- a/web.py +++ b/web.py @@ -55,6 +55,11 @@ class ReticulumWebChat: # vacuum database on start to shrink its file size sqlite_database.execute_sql("VACUUM") + # lxmf messages in outbound or sending state should be marked as failed when app starts as they are no longer being processed + (database.LxmfMessage.update(state="failed") + .where(database.LxmfMessage.state == "outbound") + .orwhere(database.LxmfMessage.state == "sending").execute()) + # init config self.config = Config()