Permalink
Browse files

MDL-35257 lib: if $CFG->logguests is disabled, avoid some log actions

This is for performance, else there can be great contention on the guest
user record as we've seen on moodle.org.
  • Loading branch information...
danpoltawski committed Sep 5, 2012
1 parent 935c3d5 commit 4501a081d344dde7a574c43665e4961d7877bc6b
Showing with 10 additions and 0 deletions.
  1. +5 −0 lib/datalib.php
  2. +5 −0 lib/moodlelib.php
View
@@ -1765,6 +1765,11 @@ function user_accesstime_log($courseid=0) {
return;
}
if (isguestuser()) {
// Do not update guest access times/ips for performance.
return;
}
if (empty($courseid)) {
$courseid = SITEID;
}
View
@@ -3295,6 +3295,11 @@ function get_user_key($script, $userid, $instance=null, $iprestriction=null, $va
function update_user_login_times() {
global $USER, $DB;
if (isguestuser()) {
// Do not update guest access times/ips for performance.
return true;
}
$now = time();
$user = new stdClass();

0 comments on commit 4501a08

Please sign in to comment.