Skip to content

Commit

Permalink
Merge branch 'MDL-51109-29' of git://github.com/danpoltawski/moodle i…
Browse files Browse the repository at this point in the history
…nto MOODLE_29_STABLE
  • Loading branch information
David Monllao committed Sep 1, 2015
2 parents b11c542 + c378540 commit d1dd5d0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions admin/tool/task/cli/schedule_task.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@
mtrace("... used " . ($DB->perf_get_queries() - $predbqueries) . " dbqueries");
mtrace("... used " . (microtime(true) - $pretime) . " seconds");
mtrace("Task failed: " . $e->getMessage());
if ($CFG->debugdeveloper) {
if (!empty($e->debuginfo)) {
mtrace("Debug info:");
mtrace($e->debuginfo);
}
mtrace("Backtrace:");
mtrace(format_backtrace($e->getTrace(), true));
}
\core\task\manager::scheduled_task_failed($task);
get_mailer('close');
exit(1);
Expand Down
16 changes: 16 additions & 0 deletions lib/cronlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ function cron_run() {
mtrace("... used " . (microtime(1) - $pretime) . " seconds");
}
mtrace("Scheduled task failed: " . $task->get_name() . "," . $e->getMessage());
if ($CFG->debugdeveloper) {
if (!empty($e->debuginfo)) {
mtrace("Debug info:");
mtrace($e->debuginfo);
}
mtrace("Backtrace:");
mtrace(format_backtrace($e->getTrace(), true));
}
\core\task\manager::scheduled_task_failed($task);
}
get_mailer('close');
Expand Down Expand Up @@ -127,6 +135,14 @@ function cron_run() {
mtrace("... used " . (microtime(1) - $pretime) . " seconds");
}
mtrace("Adhoc task failed: " . get_class($task) . "," . $e->getMessage());
if ($CFG->debugdeveloper) {
if (!empty($e->debuginfo)) {
mtrace("Debug info:");
mtrace($e->debuginfo);
}
mtrace("Backtrace:");
mtrace(format_backtrace($e->getTrace(), true));
}
\core\task\manager::adhoc_task_failed($task);
}
get_mailer('close');
Expand Down

0 comments on commit d1dd5d0

Please sign in to comment.