Update DBClean.php

This commit is contained in:
miqrogroove 2018-06-21 08:27:36 -04:00 committed by GitHub
parent d8646340c9
commit 7f4bce67a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -323,12 +323,12 @@ 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 = intval(Config::get('system', 'dbclean_expire_conversation', 7));
$days = intval(Config::get('system', 'dbclean_expire_conversation', 90));
logger("Deleting old conversations. Last created: ".$last_id);
$r = dba::p("SELECT `received`, `item-uri` FROM `conversation`
WHERE `received` < UTC_TIMESTAMP() - INTERVAL $days DAY
ORDER BY `received` LIMIT ".intval($limit));
WHERE `received` < UTC_TIMESTAMP() - INTERVAL ? DAY
ORDER BY `received` LIMIT ?", $days, intval($limit));
$count = dba::num_rows($r);
if ($count > 0) {
logger("found old conversations: ".$count);