MDL-25454: using the faster way to check if record exists in db

This commit is contained in:
Marina Glancy
2011-09-29 17:12:24 +08:00
parent b7df65036f
commit 2f81316ad1
+2 -2
View File
@@ -107,8 +107,8 @@ function schedule_backup_cron() {
//Check log if there were any modifications to the course content
$sql = 'SELECT l.id FROM '.$CFG->prefix .'log l WHERE '.
'l.course='. $course->id. ' AND l.time>'. ($now-31*24*60*60). " AND lower(l.action) not like '%view%'";
$logs = get_records_sql($sql, 0, 1);
if (empty($logs)) {
$logexists = record_exists_sql($sql);
if (!$logexists) {
mtrace(" SKIPPING - hidden+unmodified");
set_field("backup_courses", "laststatus", "3", "courseid", $backup_course->courseid);
$skipped = true;