Skip to content

Commit

Permalink
[#136] Sort by cumulative faildelay
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhilton authored and brendanheywood committed Oct 9, 2023
1 parent 004e3bb commit 5648516
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions croncheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,11 @@

// Instead of using task API here, we read directly from the database.
// This stops errors originating from broken tasks, and allows the DB to de-duplicate them.
$adhoctasks = $DB->get_records_sql(" SELECT classname, COUNT(*) count, MAX(faildelay) faildelay
$adhoctasks = $DB->get_records_sql(" SELECT classname, COUNT(*) count, MAX(faildelay) faildelay, SUM(faildelay) cfaildelay
FROM {task_adhoc}
WHERE faildelay > 0
GROUP BY classname");
GROUP BY classname
ORDER BY cfaildelay DESC");

foreach ($adhoctasks as $record) {
// Only add duplicate message if there are more than 1.
Expand Down

0 comments on commit 5648516

Please sign in to comment.