Set max execution time

This commit is contained in:
Laurent Destailleur 2021-02-04 22:14:46 +01:00
parent a4f6c2d0c6
commit 55e7bcb7ab

View File

@ -73,6 +73,15 @@ $block_static = new BlockedLog($db);
$result = restrictedArea($user, 'blockedlog', 0, '');
$max_execution_time_for_importexport = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined
$max_time = @ini_get("max_execution_time");
if ($max_time && $max_time < $max_execution_time_for_importexport)
{
dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically.");
@ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300
}
/*
* Actions
*/