Merge branch 'ent-11441-15692-aviso-sobre-agent-access-statistics-aparece-cada-dia' into 'develop'

Ent 11441 15692 aviso sobre agent access statistics aparece cada dia

See merge request artica/pandorafms!6060
This commit is contained in:
Matias Didier 2023-07-11 13:20:08 +00:00
commit 01de48631c
1 changed files with 15 additions and 11 deletions

View File

@ -679,20 +679,24 @@ class ConsoleSupervisor
*/
public function checkAccessStatisticsPerformance()
{
global $config;
$total_agents = db_get_value('count(*)', 'tagente');
if ($total_agents >= 200) {
db_process_sql_update('tconfig', ['value' => 0], ['token' => 'agentaccess']);
$this->notify(
[
'type' => 'NOTIF.ACCESSSTASTICS.PERFORMANCE',
'title' => __('Access statistics performance'),
'message' => __(
'Usage of agent access statistics IS NOT RECOMMENDED on systems with more than 200 agents due performance penalty'
),
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup&section=perf',
]
);
if ($config['agentaccess'] !== 0) {
db_process_sql_update('tconfig', ['value' => 0], ['token' => 'agentaccess']);
$this->notify(
[
'type' => 'NOTIF.ACCESSSTASTICS.PERFORMANCE',
'title' => __('Access statistics performance'),
'message' => __(
'Usage of agent access statistics IS NOT RECOMMENDED on systems with more than 200 agents due performance penalty'
),
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup&section=perf',
]
);
}
} else {
$this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE');
}