mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 11:56:40 +02:00
MDL-78580 report_statistics: Prevent database deadlocks when viewing
If a quiz had a long job to calculate statstics running, this would cause pages that may also attempt a recalculation (the statistics report page or question bank) to load very slowly, and possibly result in a database deadlock. This change will firstly prevent the question bank page performing analysis calculations at all, since these are not required for this page, which will speed up loading and prevent deadlocks on this page. Secondly, this adds a lock to the recalcuation process so that it cannot run twice concurrently. This will present the user with a message to indicate that it is waiting for a running calculation until it is complete, and eventually it will timeout with a message and debugging.
This commit is contained in:
parent
b4c6ed3650
commit
a92e5c5770
8 changed files with 413 additions and 33 deletions
|
@ -257,10 +257,9 @@ class calculator {
|
|||
}
|
||||
}
|
||||
$this->stats->cache($qubaids);
|
||||
|
||||
// All finished.
|
||||
$this->progress->end_progress();
|
||||
}
|
||||
// All finished.
|
||||
$this->progress->end_progress();
|
||||
return $this->stats;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue