From 44e546af395430be71a0078e48945127d3244b83 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Thu, 1 Feb 2024 17:34:42 +0100 Subject: [PATCH] minor fix --- .../include/class/ConsoleSupervisor.php | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index a7676d4b40..c01be47c4f 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -1145,7 +1145,7 @@ class ConsoleSupervisor public function checkAttachment() { global $config; - +hd("dadsada", true); if (is_writable($config['attachment_store']) !== true) { $this->notify( [ @@ -1163,22 +1163,6 @@ class ConsoleSupervisor $this->cleanNotifications('NOTIF.WRITABLE.ATTACHMENT'); } - $filecount = 0; - - $agentId = db_get_value('id_agente', 'tagente', 'nombre', 'pandora.internals'); - if ($agentId !== false) { - $agent = new Agent($agentId); - - $moduleId = $agent->searchModules( - ['nombre' => 'Data_in_files'], - 1 - )->toArray()['id_agente_modulo']; - - if ($moduleId > 0) { - $filecount = (int) modules_get_last_value($moduleId); - } - } - if ($filecount > $config['num_files_attachment']) { $this->notify( [ @@ -1292,17 +1276,28 @@ class ConsoleSupervisor $MAX_FILES_DATA_IN = 1000; $MAX_BADXML_FILES_DATA_IN = 150; - $filecount = $this->countFiles( - $remote_config_dir, - '', - $MAX_FILES_DATA_IN - ); + $filecount = 0; + + $agentId = db_get_value('id_agente', 'tagente', 'nombre', 'pandora.internals'); + if ($agentId !== false) { + $agent = new Agent($agentId); + + $moduleId = $agent->searchModules( + ['nombre' => 'Data_in_files'], + 1 + )->toArray()['id_agente_modulo']; + + if ($moduleId > 0) { + $filecount = (int) modules_get_last_value($moduleId); + } + } +hd($filecount, true); // If cannot open directory, count is '-1', skip. if ($filecount > $MAX_FILES_DATA_IN) { $this->notify( [ 'type' => 'NOTIF.FILES.DATAIN', - 'title' => __('There are too much files in spool').'.', + 'title' => __('There are too many files in spool').'.', 'message' => __( 'There are more than %d files in %s. Consider checking DataServer performance', $MAX_FILES_DATA_IN,