]> git.mjollnir.org Git - moodle.git/commitdiff
Delete old cached texts on a cleanup
authormoodler <moodler>
Mon, 9 Feb 2004 12:33:02 +0000 (12:33 +0000)
committermoodler <moodler>
Mon, 9 Feb 2004 12:33:02 +0000 (12:33 +0000)
admin/cron.php

index bd73bc78d14adae013062ea73daaba5086b2f121..ca028cb9d63b6caaf9a8443b66adabd98a97e7d7 100644 (file)
             $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")) {