mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
Avoid to execute non cron complianced modules on creation
Former-commit-id: edfb13175ca00bc5aee99609c0eec30e06d5936e
This commit is contained in:
parent
05ce178854
commit
4fd3aa3a51
@ -20,15 +20,17 @@ function cron_update_module_interval($module_id, $cron)
|
|||||||
{
|
{
|
||||||
// Check for a valid cron.
|
// Check for a valid cron.
|
||||||
if (!cron_check_syntax($cron)) {
|
if (!cron_check_syntax($cron)) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cron == '* * * * *') {
|
$module_interval = db_get_value(
|
||||||
$module_interval = db_get_value_filter(
|
'module_interval',
|
||||||
'module_interval',
|
'tagente_modulo',
|
||||||
'tagente_modulo',
|
'id_agente_modulo',
|
||||||
['id_agente_modulo' => $module_id]
|
$module_id
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($cron === '* * * * *') {
|
||||||
return db_process_sql(
|
return db_process_sql(
|
||||||
'UPDATE tagente_estado SET current_interval = '.$module_interval.' WHERE id_agente_modulo = '.(int) $module_id
|
'UPDATE tagente_estado SET current_interval = '.$module_interval.' WHERE id_agente_modulo = '.(int) $module_id
|
||||||
);
|
);
|
||||||
|
@ -663,10 +663,11 @@ function modules_create_agent_module(
|
|||||||
'estado' => $status,
|
'estado' => $status,
|
||||||
'known_status' => $status,
|
'known_status' => $status,
|
||||||
'id_agente' => (int) $id_agent,
|
'id_agente' => (int) $id_agent,
|
||||||
'utimestamp' => 0,
|
'utimestamp' => (time() - (int) $values['interval']),
|
||||||
'status_changes' => 0,
|
'status_changes' => 0,
|
||||||
'last_status' => $status,
|
'last_status' => $status,
|
||||||
'last_known_status' => $status,
|
'last_known_status' => $status,
|
||||||
|
'current_interval' => (int) $values['interval'],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user