From c466886e9bc4fda13ee66c87a515bb7a7b24d5f7 Mon Sep 17 00:00:00 2001 From: Chris Sangwin Date: Wed, 22 Jan 2025 15:07:40 +0000 Subject: [PATCH] Up default timeout for install to 30s. --- db/install.php | 2 +- stack/cas/connectorhelper.class.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/db/install.php b/db/install.php index 2d3cf66abb..b7c46b4dce 100644 --- a/db/install.php +++ b/db/install.php @@ -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'); diff --git a/stack/cas/connectorhelper.class.php b/stack/cas/connectorhelper.class.php index 9b05ef8e87..7e9103cf83 100644 --- a/stack/cas/connectorhelper.class.php +++ b/stack/cas/connectorhelper.class.php @@ -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); @@ -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;