-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
4.5.1
-
MOODLE_405_STABLE
There is no point in setting:
$upgraderunning = 0;
In the code below:
https://github.com/moodle/moodle/blob/269a8a8a1b3965e95e713ccc93ad1b7eb0d0e249/lib/upgradelib.php#L292
if (!$upgraderunning) {
if (CLI_SCRIPT) {
// never stop CLI upgrades
$upgraderunning = 0;
} else {
// web upgrade not running or aborted throw new moodle_exception('upgradetimedout', 'admin', "$CFG>wwwroot/$CFG>admin/");
}
}
As $upgraderunning is then not used for anything that setting it to 0 would influence.
The code above would be equivalent to:
if (!$upgraderunning && !CLI_SCRIPT)
{ // web upgrade not running or aborted throw new \moodle_exception('upgradetimedout', 'admin', "$CFG->wwwroot/$CFG->admin/"); }
I also have some doubts about the logic here - when would the above condition (when $upgraderunning is false) trigger?