Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some outputting debugging info for cron. Merged from 16stable.

  • Loading branch information...
commit f9bfa458a2f79d2598491e166095101160bc04fb 1 parent 6d19caa
ethem authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 enrol/authorize/enrol.php
View
13 enrol/authorize/enrol.php
@@ -694,15 +694,21 @@ function cron()
$mconfig = get_config('enrol/authorize');
set_config('an_lastcron', $timenow, 'enrol/authorize');
+ mtrace("Processing authorize cron...");
+
if (intval($mconfig->an_dailysettlement) < $settlementtime) {
set_config('an_dailysettlement', $settlementtime, 'enrol/authorize');
+ mtrace(" daily cron: some cleanups and sending email to admins the count of pending orders expiring", "...");
$this->cron_daily();
+ mtrace("done", "\n");
}
+ mtrace(" scheduled capture", ": ");
if (empty($CFG->an_review) or
(!empty($CFG->an_test)) or
(intval($CFG->an_capture_day) < 1) or
(!$this->check_openssl_loaded())) {
+ mtrace("disabled", "\n");
return; // order review disabled or test mode or manual capture or openssl wasn't loaded.
}
@@ -714,6 +720,7 @@ function cron()
" AND (E.timecreated < '$timediffcnf') AND (E.timecreated > '$timediff30')";
if (!$orders = get_records_sql($sql)) {
+ mtrace("no pending orders", "\n");
return;
}
@@ -723,9 +730,12 @@ function cron()
$ordercount = count((array)$orders);
if (($ordercount * $eachconn) + intval($mconfig->an_lastcron) > $timenow) {
+ mtrace("blocked", "\n");
return;
}
+ mtrace($ordercount ." orders are processing", "\n");
+
$faults = '';
$sendem = array();
$elapsed = time();
@@ -788,6 +798,8 @@ function cron()
if (empty($sendem)) {
return;
}
+
+ mtrace(" sending welcome messages to students", ": ");
$select = "SELECT E.id, E.courseid, E.userid, C.fullname " .
"FROM {$CFG->prefix}enrol_authorize E " .
"INNER JOIN {$CFG->prefix}course C ON C.id = E.courseid " .
@@ -813,6 +825,7 @@ function cron()
$emailmessage);
$i = $j;
}
+ mtrace("sent", "\n");
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.