From: moodler Date: Mon, 9 Feb 2004 12:33:02 +0000 (+0000) Subject: Delete old cached texts on a cleanup X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cb3a44841555866b83470f9af7a9b2b3000529bf;p=moodle.git Delete old cached texts on a cleanup --- diff --git a/admin/cron.php b/admin/cron.php index bd73bc78d1..ca028cb9d6 100644 --- a/admin/cron.php +++ b/admin/cron.php @@ -96,6 +96,13 @@ $loglifetime = $timenow - ($CFG->loglifetime * 3600 * 24); delete_records_select("log", "time < '$loglifetime'"); } + + /// Delete old cached texts + + if (!empty($CFG->cachetext)) { // Defined in config.php + $cachelifetime = time() - $CFG->cachetext; + delete_records_select("text_cache", "timemodified < '$cachelifetime'"); + } } if (file_exists("$CFG->dataroot/cronextra.php")) {