Skip to content

Commit

Permalink
Up default timeout for install to 30s.
Browse files Browse the repository at this point in the history
  • Loading branch information
sangwinc committed Jan 22, 2025
1 parent bbc4758 commit c466886
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function xmldb_qtype_stack_install() {
// Set to the same defaults as in settings.php - however, that has not been done
// yet in the Moodle install code flow, so we have to duplicate here.
set_config('maximaversion', 'default', 'qtype_stack');
set_config('castimeout', 20, 'qtype_stack');
set_config('castimeout', 30, 'qtype_stack');
set_config('casresultscache', 'db', 'qtype_stack');
set_config('caspreparse', 'true', 'qtype_stack');
set_config('maximacommand', '', 'qtype_stack');
Expand Down
3 changes: 2 additions & 1 deletion stack/cas/connectorhelper.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ private static function stackmaxima_nocache_call($command) {
$casdebugging = self::$config->casdebugging;
self::$config->casresultscache = 'none';
self::$config->casdebugging = true;
self::$config->castimeout = min(30, self::$config->castimeout);

$connection = self::make();
$results = $connection->compute($command);
Expand Down Expand Up @@ -455,7 +456,7 @@ public static function stackmaxima_auto_maxima_optimise($genuinedebug) {
$success = true;

// Add the timeout command to the message.
$commandline = 'timeout --kill-after=10s 10s '.$rawcommand;
$commandline = 'timeout --kill-after=30s 30s '.$rawcommand;
$message = stack_string('healthautomaxopt_ok', ['command' => $commandline]);
if (!file_exists($imagename)) {
$success = false;
Expand Down

0 comments on commit c466886

Please sign in to comment.