Skip to content

Commit

Permalink
Alternate fix for get_min_duration_for_reason exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Fragonite committed Dec 5, 2023
1 parent 91e805b commit 13ecda3
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions classes/web_processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,27 @@ public function init(manager $manager) {
$this->profile->set('created', $this->sampleset->starttime);

$manager->get_timer()->setCallback(function () use ($manager) {
$this->process($manager, false);
try {
$this->process($manager, false);
} catch (\dml_exception $e) {
// Ignore errors during processing.
debugging('tool_excimer: Timer callback failed: ' . $e->getMessage());
}
});

\core_shutdown_manager::register_function(
function () use ($manager) {
$manager->get_timer()->stop();
$manager->get_profiler()->stop();

// Keep an approximate count of each profile.
$this->process($manager, true);
page_group::record_fuzzy_counts($this->profile);
try {
$manager->get_timer()->stop();
$manager->get_profiler()->stop();

// Keep an approximate count of each profile.
$this->process($manager, true);
page_group::record_fuzzy_counts($this->profile);
} catch (\dml_exception $e) {
// Ignore errors during processing.
debugging('tool_excimer: Shutdown callback failed: ' . $e->getMessage());
}
}
);
}
Expand Down

0 comments on commit 13ecda3

Please sign in to comment.