From 2f81316ad17d7653dc641aca41a69db7fd88cfdf Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Thu, 29 Sep 2011 17:12:24 +0800 Subject: [PATCH] MDL-25454: using the faster way to check if record exists in db --- backup/backup_scheduled.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup/backup_scheduled.php b/backup/backup_scheduled.php index b6041c22e18..55199accacb 100644 --- a/backup/backup_scheduled.php +++ b/backup/backup_scheduled.php @@ -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;