Fix delete_old_message when using sqlite spool table

This fixes issue #3503
This commit is contained in:
Paweł Chmielowski 2021-01-27 19:40:35 +01:00
parent 5c3b3d22db
commit f7004f793d
1 changed files with 5 additions and 0 deletions

View File

@ -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"