From: moodler Date: Sun, 4 May 2003 03:46:15 +0000 (+0000) Subject: Don't throw errors when deleting old logs and unsent mail X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d7c8a46bc50a185adf93d245bd5c3cbd97842f46;p=moodle.git Don't throw errors when deleting old logs and unsent mail --- diff --git a/admin/cron.php b/admin/cron.php index cf23da58dd..00bdf1afb1 100644 --- a/admin/cron.php +++ b/admin/cron.php @@ -66,13 +66,18 @@ } } + +/// Delete old queued mail that didn't get sent within 30 minutes + + $oldmailtime = $timenow - 1800; + delete_records_select("mail_queue", "timecreated < '$oldmailtime'"); + + /// Delete old logs to save space (this might need a timer to slow it down...) if (!empty($CFG->loglifetime)) { // value in days $loglifetime = $timenow - ($CFG->loglifetime * 3600 * 24); - if (!delete_records_select("log", "time < '$loglifetime'")) { - echo "Error occurred while deleting old logs! (before $loglifetime)"; - } + delete_records_select("log", "time < '$loglifetime'"); } echo "Cron script completed correctly\n";