]> granicus.if.org Git - ejabberd/commitdiff
Fix PostgreSQL compatibility in mod_offline_sql:remove_old_messages (#2695)
authorAlexey Shchepin <alexey@process-one.net>
Sat, 18 May 2019 18:16:33 +0000 (21:16 +0300)
committerAlexey Shchepin <alexey@process-one.net>
Sat, 18 May 2019 18:16:45 +0000 (21:16 +0300)
src/mod_offline_sql.erl

index cb0efa51e4921cfbf69fa2b652f64588d65fdd26..97231695455a6f084ff4a4c890f821cac2c5f2ec 100644 (file)
@@ -94,7 +94,7 @@ remove_old_messages(Days, LServer) ->
                    ejabberd_sql:sql_query_t(
                      ?SQL("DELETE FROM spool"
                           " WHERE created_at <"
-                          " NOW() - INTERVAL '%(Days)d DAY'"));
+                          " NOW() - %(Days)d * INTERVAL '1 DAY'"));
               (_, _) ->
                    ejabberd_sql:sql_query_t(
                      ?SQL("DELETE FROM spool"