Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 879c7655f255f07856bb8fb1065c2eb6cb933653 1 parent 555112a
@danpoltawski danpoltawski authored
Showing with 10 additions and 0 deletions.
  1. +5 −0 lib/datalib.php
  2. +5 −0 lib/moodlelib.php
View
5 lib/datalib.php
@@ -1762,6 +1762,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
5 lib/moodlelib.php
@@ -3201,6 +3201,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();
Please sign in to comment.
Something went wrong with that request. Please try again.