Fixed current_interval in data server

This commit is contained in:
Daniel Maya 2017-06-08 17:04:43 +02:00
parent 8e230a4883
commit aec9251b88

View File

@ -26,9 +26,15 @@ function cron_update_module_interval ($module_id, $cron) {
return;
}
if($cron == "* * * * *"){
$module_interval = db_get_value_filter('module_interval','tagente_modulo',array("id_agente_modulo" => $module_id));
return db_process_sql ('UPDATE tagente_estado SET current_interval = ' . $module_interval . ' WHERE id_agente_modulo = ' . (int) $module_id);
} else {
return db_process_sql ('UPDATE tagente_estado SET current_interval = ' . cron_next_execution ($cron) . ' WHERE id_agente_modulo = ' . (int) $module_id);
}
}
// Get the number of seconds left to the next execution of the given cron entry.
function cron_next_execution ($cron) {