From 62e61a75f7c4f3152e16a0b267a578fba1cbba29 Mon Sep 17 00:00:00 2001 From: miqrogroove Date: Thu, 21 Jun 2018 07:43:40 -0400 Subject: [PATCH] Make Conversation Cleanup Configurable --- src/Worker/DBClean.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Worker/DBClean.php b/src/Worker/DBClean.php index 20691c178e..0fdcbfee6d 100644 --- a/src/Worker/DBClean.php +++ b/src/Worker/DBClean.php @@ -323,10 +323,11 @@ class DBClean { Config::set('system', 'dbclean-last-id-9', $last_id); } elseif ($stage == 10) { $last_id = Config::get('system', 'dbclean-last-id-10', 0); + $days = Config::get('system', 'dbclean-expire-conversation', 7); logger("Deleting old conversations. Last created: ".$last_id); $r = dba::p("SELECT `received`, `item-uri` FROM `conversation` - WHERE `received` < UTC_TIMESTAMP() - INTERVAL 90 DAY + WHERE `received` < UTC_TIMESTAMP() - INTERVAL $days DAY ORDER BY `received` LIMIT ".intval($limit)); $count = dba::num_rows($r); if ($count > 0) { -- 2.39.5