From f6285de2acdf3e3eb2fd5d4e217215ba276387f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Aug 2023 14:48:18 +0200 Subject: [PATCH] FIX Solve timeout when deploying compex modules --- htdocs/admin/modules.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 464f3e72e97..3cd35480a5d 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -113,6 +113,14 @@ $urldolibarrmodules = 'https://www.dolistore.com/'; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('adminmodules', 'globaladmin')); +// Execution Time +$max_execution_time_for_deploy = (empty($conf->global->MODULE_UPLOAD_MAX_EXECUTION_TIME) ? 300 : $conf->global->MODULE_UPLOAD_MAX_EXECUTION_TIME); // 5mn if not defined +$max_time = @ini_get("max_execution_time"); +if ($max_time && $max_time < $max_execution_time_for_deploy) { + dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_deploy=".$max_execution_time_for_deploy.". We try to increase it dynamically."); + @ini_set("max_execution_time", $max_execution_time_for_deploy); // This work only if safe mode is off. also web servers has timeout of 300 +} + /* * Actions