diff --git a/CHANGELOG.md b/CHANGELOG.md index 09eb8f00cd..2b78bd8088 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Fixed + - Ensure that the `Taskjob` identifier is used to extract the device IP. - Isolate dynamic group criteria to prevent their global reapplication in GLPI. +- Fixes memory exhaustion when "extra-debug" is disabled ## [1.4.0] - 2024-09-06 diff --git a/inc/task.class.php b/inc/task.class.php index 0ba50e5029..23648d0b38 100644 --- a/inc/task.class.php +++ b/inc/task.class.php @@ -1332,19 +1332,21 @@ public function ajaxGetJobLogs($options = []) session_write_close(); $logs = $this->getJoblogs($task_ids, true, false); - PluginGlpiinventoryToolbox::logIfExtradebug( - "pluginGlpiinventory-tasks", - "ajaxGetJobLogs, agents: " . count($logs['agents']) - ); - PluginGlpiinventoryToolbox::logIfExtradebug( - "pluginGlpiinventory-tasks", - "ajaxGetJobLogs, tasks: " . count($logs['tasks']) - ); + if (PluginGlpiinventoryConfig::isExtradebugActive()) { + PluginGlpiinventoryToolbox::logIfExtradebug( + "pluginGlpiinventory-tasks", + "ajaxGetJobLogs, agents: " . count($logs['agents']) + ); + PluginGlpiinventoryToolbox::logIfExtradebug( + "pluginGlpiinventory-tasks", + "ajaxGetJobLogs, tasks: " . count($logs['tasks']) + ); - PluginGlpiinventoryToolbox::logIfExtradebug( - "pluginGlpiinventory-tasks", - "ajaxGetJobLogs: " . print_r($logs, true) - ); + PluginGlpiinventoryToolbox::logIfExtradebug( + "pluginGlpiinventory-tasks", + "ajaxGetJobLogs: " . print_r($logs, true) + ); + } $out = json_encode($logs); if ( isset($options['display'])