Make Conversation Cleanup Configurable
This commit is contained in:
parent
e84c48b979
commit
62e61a75f7
1 changed files with 2 additions and 1 deletions
|
@ -323,10 +323,11 @@ class DBClean {
|
||||||
Config::set('system', 'dbclean-last-id-9', $last_id);
|
Config::set('system', 'dbclean-last-id-9', $last_id);
|
||||||
} elseif ($stage == 10) {
|
} elseif ($stage == 10) {
|
||||||
$last_id = Config::get('system', 'dbclean-last-id-10', 0);
|
$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);
|
logger("Deleting old conversations. Last created: ".$last_id);
|
||||||
$r = dba::p("SELECT `received`, `item-uri` FROM `conversation`
|
$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));
|
ORDER BY `received` LIMIT ".intval($limit));
|
||||||
$count = dba::num_rows($r);
|
$count = dba::num_rows($r);
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
|
|
Loading…
Reference in a new issue