N°6901 - Enable tracking of iTop active sessions (monitoring) (#568)

Co-authored-by: Molkobain <lajarige.guillaume@free.fr>
Co-authored-by: Romain Quetiez <romain.quetiez@combodo.com>
This commit is contained in:
odain-cbd
2023-11-22 17:46:00 +01:00
committed by GitHub
parent 88008b3925
commit 9a59bc7890
12 changed files with 581 additions and 33 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace Combodo\iTop\SessionTracker;
/**
* Class SessionGC
*
* @author Olivier Dain <olivier.dain@combodo.com>
* @package Combodo\iTop\SessionTracker
* @since 3.1.1 3.2.0 N°6901
*/
class SessionGC implements \iBackgroundProcess
{
/**
* @inheritDoc
*/
public function GetPeriodicity()
{
return 60 * 1; // seconds
}
/**
* @inheritDoc
*/
public function Process($iTimeLimit)
{
$iMaxLifetime = ini_get('session.gc_maxlifetime') ?? 1440;
$oSessionHandler = new SessionHandler();
$iProcessed = $oSessionHandler->gc_with_time_limit($iMaxLifetime, $iTimeLimit);
return "processed $iProcessed tasks";
}
}