From: Alexander Ebert Date: Fri, 8 Mar 2019 11:59:56 +0000 (+0100) Subject: Periodically prune the SFS database X-Git-Tag: 5.2.0_Alpha_1~228^2~1^2^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fdcfe9782a1d09d13fee17ab6f9d243eebb0ce88;p=GitHub%2FWoltLab%2FWCF.git Periodically prune the SFS database --- diff --git a/wcfsetup/install/files/lib/system/cronjob/DailyCleanUpCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/DailyCleanUpCronjob.class.php index e3dafc8407..00c4061c44 100644 --- a/wcfsetup/install/files/lib/system/cronjob/DailyCleanUpCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/DailyCleanUpCronjob.class.php @@ -186,5 +186,23 @@ class DailyCleanUpCronjob extends AbstractCronjob { } } } + + if (BLACKLIST_SFS_ENABLE) { + $timeLimit = TIME_NOW - 31 * 86400; + + $sql = "DELETE FROM wcf".WCF_N."_blacklist_entry + WHERE lastSeen < ?"; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute([ + gmdate('Y-m-d H:i:s', $timeLimit) + ]); + + $sql = "DELETE FROM wcf".WCF_N."_blacklist_status + WHERE date < ?"; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute([ + gmdate('Y-m-d', $timeLimit) + ]); + } } }