2013-07-24 Juan Manuel Ramon Vigo <juanmanuel.ramon@artica.es>
* include/functions_forecast.php: Avoid timeout in prediction date item report. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8565 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
9636e142da
commit
cafbfd7dc0
|
@ -1,3 +1,8 @@
|
||||||
|
2013-07-24 Juan Manuel Ramon Vigo <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
|
* include/functions_forecast.php: Avoid timeout in prediction date
|
||||||
|
item report.
|
||||||
|
|
||||||
2013-07-24 Sergio Martin <sergio.martin@artica.es>
|
2013-07-24 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* include/functions_visual_map.php
|
* include/functions_visual_map.php
|
||||||
|
|
|
@ -34,6 +34,16 @@
|
||||||
function forecast_projection_graph($module_id, $period = 5184000, $prediction_period, $max_value = false, $min_value = false, $csv = false){
|
function forecast_projection_graph($module_id, $period = 5184000, $prediction_period, $max_value = false, $min_value = false, $csv = false){
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
$max_exec_time = ini_get('max_execution_time');
|
||||||
|
|
||||||
|
if ($max_exec_time !== false) {
|
||||||
|
|
||||||
|
$max_exec_time = (int)$max_exec_time;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$begin_time = time();
|
||||||
|
|
||||||
$module_data=grafico_modulo_sparse ($module_id, $period, 0,
|
$module_data=grafico_modulo_sparse ($module_id, $period, 0,
|
||||||
300, 300 , '', null,
|
300, 300 , '', null,
|
||||||
false, 0, false,
|
false, 0, false,
|
||||||
|
@ -187,6 +197,15 @@ function forecast_projection_graph($module_id, $period = 5184000, $prediction_pe
|
||||||
$idx = 0;
|
$idx = 0;
|
||||||
// Create data in graph format like
|
// Create data in graph format like
|
||||||
while ($in_range) {
|
while ($in_range) {
|
||||||
|
$now = time();
|
||||||
|
|
||||||
|
// Check that exec time is not greater than half max exec server time
|
||||||
|
if ($max_exec_time !== false) {
|
||||||
|
if (($begin_time + ($max_exec_time/2)) < $now) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$timestamp_f = date($time_format, $current_ts);
|
$timestamp_f = date($time_format, $current_ts);
|
||||||
|
|
||||||
//$timestamp_f = date($time_format, $current_ts);
|
//$timestamp_f = date($time_format, $current_ts);
|
||||||
|
|
Loading…
Reference in New Issue