Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-32985 cron: Fixing related problem with setting of lastnotifyfailure

Because of a flaw in the logic, lastnotifyfailure was not set unless
there was a failure. This means that after 1 hour of no failures, the
function would execute every cron cycle, which has a pretty high cost
on large sites.
  • Loading branch information...
commit 54c2756ca21e74ad89a5c922e47287477f3add55 1 parent 4a5be0e
@merrill-oakland merrill-oakland authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/cronlib.php
View
6 lib/cronlib.php
@@ -711,11 +711,11 @@ function notify_login_failures() {
//emailing the admins directly rather than putting these through the messaging system
email_to_user($admin,get_admin(), $subject, $body);
}
-
- // Update lastnotifyfailure with current time
- set_config('lastnotifyfailure', time());
}
+ // Update lastnotifyfailure with current time
+ set_config('lastnotifyfailure', time());
+
// Finally, delete all the temp records we have created in cache_flags
$DB->delete_records_select('cache_flags', "flagtype IN ('login_failure_by_ip', 'login_failure_by_info')");
Please sign in to comment.
Something went wrong with that request. Please try again.