Skip to content

Commit

Permalink
MDL-31553 do not timeout CLI upgrade scripts
Browse files Browse the repository at this point in the history
Credit goes to Michael Aherne.
  • Loading branch information
skodak committed Apr 22, 2012
1 parent ead4f18 commit 5563f5f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/upgradelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ function upgrade_set_timeout($max_execution_time=300) {
return;
}

set_time_limit($max_execution_time);
if (CLI_SCRIPT) {
// there is no point in timing out of CLI scripts, admins can stop them if necessary
set_time_limit(0);
} else {
set_time_limit($max_execution_time);
}
set_config('upgraderunning', $expected_end); // keep upgrade locked until this time
}

Expand Down

0 comments on commit 5563f5f

Please sign in to comment.