Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MDL-32607 prevent upgrade_set_timeout abort in CLI scripts
Credit goes to Michael Aherne, thanks.
  • Loading branch information
skodak committed Apr 27, 2012
1 parent 446dbee commit 9257815
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/moodlelib.php
Expand Up @@ -8564,9 +8564,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) {
Expand Down

0 comments on commit 9257815

Please sign in to comment.