mirror of
https://github.com/moodle/moodle.git
synced 2025-04-26 10:54:21 +02:00
MDL-32607 prevent upgrade_set_timeout abort in CLI scripts
Credit goes to Michael Aherne, thanks.
This commit is contained in:
parent
aa753ac24f
commit
b814d1b4b2
@ -116,9 +116,13 @@ function upgrade_set_timeout($max_execution_time=300) {
|
||||
}
|
||||
|
||||
if (!$upgraderunning) {
|
||||
// upgrade not running or aborted
|
||||
print_error('upgradetimedout', 'admin', "$CFG->wwwroot/$CFG->admin/");
|
||||
die;
|
||||
if (CLI_SCRIPT) {
|
||||
// never stop CLI upgrades
|
||||
$upgraderunning = 0;
|
||||
} else {
|
||||
// web upgrade not running or aborted
|
||||
print_error('upgradetimedout', 'admin', "$CFG->wwwroot/$CFG->admin/");
|
||||
}
|
||||
}
|
||||
|
||||
if ($max_execution_time < 60) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user