Permalink
Browse files

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

  • Loading branch information...
1 parent b7df650 commit 2f81316ad17d7653dc641aca41a69db7fd88cfdf @marinaglancy marinaglancy committed Sep 29, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 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;

0 comments on commit 2f81316

Please sign in to comment.