Don't throw errors when deleting old logs and unsent mail

This commit is contained in:
moodler
2003-05-04 03:46:15 +00:00
parent 9f0b8269ac
commit d7c8a46bc5
+8 -3
View File
@@ -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";