]> git.mxchange.org Git - friendica.git/commitdiff
Make Conversation Cleanup Configurable
authormiqrogroove <miqrogroove@gmail.com>
Thu, 21 Jun 2018 11:43:40 +0000 (07:43 -0400)
committerGitHub <noreply@github.com>
Thu, 21 Jun 2018 11:43:40 +0000 (07:43 -0400)
src/Worker/DBClean.php

index 20691c178e052f5385efd049f87ae4c1917a76f3..0fdcbfee6db4198f7b47faeade89247238c41c63 100644 (file)
@@ -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) {