Merge branch 'ent-5760-problema-sistema-de-notificaciones-en-servidores-con-pocos-modulos' into 'develop'

Avoid performance tests if there are not enough modules in system

See merge request artica/pandorafms!3765
This commit is contained in:
Daniel Rodriguez 2021-03-09 16:31:38 +00:00
commit 39e735ed22
1 changed files with 11 additions and 0 deletions

View File

@ -45,6 +45,11 @@ enterprise_include_once('include/functions_cron.php');
class ConsoleSupervisor
{
/**
* Minimum modules to check performance.
*/
public const MIN_PERFORMANCE_MODULES = 100;
/**
* Show if console supervisor is enabled or not.
*
@ -1143,6 +1148,12 @@ class ConsoleSupervisor
$max_grown = ($total_modules[$queue['server_type']] * 0.40);
}
if ($total_modules[$queue['server_type']] < self::MIN_PERFORMANCE_MODULES) {
$this->cleanNotifications('NOTIF.SERVER.QUEUE.'.$key);
// Skip.
continue;
}
// Compare queue increments in a not over 900 seconds.
if (empty($previous[$key]['modules'])
|| ($time - $previous[$key]['utime']) > 900