Merge branch 'ent-6964-giss-agentes-cargados-por-csv-no-sincronizan-con-metaconsola' into 'develop'

Force sync all new agents if node has metaconsole and agent cache is enabled

See merge request artica/pandorafms!4268
This commit is contained in:
vgilc 2021-07-08 10:18:51 +00:00
commit 1f27bb3479
1 changed files with 7 additions and 0 deletions

View File

@ -251,6 +251,13 @@ function agents_create_agent(
return false;
}
if (has_metaconsole() === true
&& (bool) $config['metaconsole_agent_cache'] === true
) {
// Force an update of the agent cache.
$values['update_module_count'] = 1;
}
$id_agent = db_process_sql_insert('tagente', $values);
if ($id_agent === false) {
return false;