Try to fix import/export timeout by dynamic increase
This commit is contained in:
parent
92942870dc
commit
c9e232f2ff
@ -288,7 +288,7 @@ function getResultColumn($name, array $activated, array $loaded, array $function
|
||||
$html .= ' '.$langs->trans("PHPSupport", $name);
|
||||
}
|
||||
} else {
|
||||
if (strtolower($name) == 'xdebug') $html .= yn(0);
|
||||
if (strtolower($name) == 'xdebug') $html .= yn(0).' - ';
|
||||
else $html .= img_warning($langs->trans("ModuleActivated", "xdebug"));
|
||||
if (in_array(strtolower($name), $loaded)) {
|
||||
$html .= ' '.$langs->trans("Loaded").' - ';
|
||||
|
||||
@ -270,11 +270,12 @@ if ($step == 1 || $action == 'cleanselect')
|
||||
|
||||
if ($action == 'builddoc')
|
||||
{
|
||||
$max_execution_time_for_export = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined
|
||||
$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_export)
|
||||
if ($max_time && $max_time < $max_execution_time_for_importexport)
|
||||
{
|
||||
@ini_set("max_execution_time", $max_execution_time_for_export); // This work only if safe mode is off. also web servers has timeout of 300
|
||||
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
|
||||
}
|
||||
|
||||
// Build export file
|
||||
|
||||
@ -1518,6 +1518,14 @@ if ($step == 5 && $datatoimport)
|
||||
}
|
||||
print '</div>';
|
||||
} else {
|
||||
$max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_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
|
||||
}
|
||||
|
||||
// Launch import
|
||||
$arrayoferrors = array();
|
||||
$arrayofwarnings = array();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user