From f7004f793d0d15f7213be14e31f2ae0dc5c0783b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Wed, 27 Jan 2021 19:40:35 +0100 Subject: [PATCH] Fix delete_old_message when using sqlite spool table This fixes issue #3503 --- src/mod_offline_sql.erl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mod_offline_sql.erl b/src/mod_offline_sql.erl index 95d379c6e..4e8441b7f 100644 --- a/src/mod_offline_sql.erl +++ b/src/mod_offline_sql.erl @@ -94,6 +94,11 @@ remove_old_messages(Days, LServer) -> ?SQL("DELETE FROM spool" " WHERE created_at <" " NOW() - %(Days)d * INTERVAL '1 DAY'")); + (sqlite, _) -> + ejabberd_sql:sql_query_t( + ?SQL("DELETE FROM spool" + " WHERE created_at <" + " DATETIME('now', '-%(Days)d days')")); (_, _) -> ejabberd_sql:sql_query_t( ?SQL("DELETE FROM spool"