1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00
This commit is contained in:
Daniel Neto 2023-08-16 20:11:45 -03:00
parent c7c12525ea
commit 00f383eb49
16 changed files with 534 additions and 157 deletions

View file

@ -396,6 +396,25 @@ class Cache extends PluginAbstract {
return CachesInDB::_deleteCacheStartingWith('firstPage');
}
public static function deleteOldCache($days, $limit = 5000) {
global $global;
$days = intval($days);
if (!empty($days)) {
$sql = "DELETE FROM CachesInDB ";
$sql .= " WHERE created < DATE_SUB(NOW(), INTERVAL ? DAY) ";
$sql .= " LIMIT $limit";
$global['lastQuery'] = $sql;
return sqlDAL::writeSql($sql, "i", [$days]);
}
return false;
}
function executeEveryMinute() {
global $global;
$global['systemRootPath'] . 'plugin/Cache/deleteStatistics.json.php';
self::deleteOldCache(1);
}
}
function sanitize_output($buffer) {