mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°6043 - Booking: Add prerequisites in iTop core - CRUD extensibility (#520)
This commit is contained in:
45
sources/Service/TemporaryObjects/TemporaryObjectGC.php
Normal file
45
sources/Service/TemporaryObjects/TemporaryObjectGC.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Service\TemporaryObjects;
|
||||
|
||||
use iBackgroundProcess;
|
||||
|
||||
/**
|
||||
* TemporaryObjectGC.
|
||||
*
|
||||
* Background task to collect and garbage expired temporary objects..
|
||||
*
|
||||
* @since 3.1
|
||||
*/
|
||||
class TemporaryObjectGC implements iBackgroundProcess
|
||||
{
|
||||
/** @var TemporaryObjectManager */
|
||||
private TemporaryObjectManager $oTemporaryObjectManager;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Retrieve service dependencies
|
||||
$this->oTemporaryObjectManager = TemporaryObjectManager::GetInstance();
|
||||
}
|
||||
|
||||
/** @inheritDoc * */
|
||||
public function GetPeriodicity()
|
||||
{
|
||||
return TemporaryObjectConfig::GetInstance()->GetWatchdogInterval();
|
||||
}
|
||||
|
||||
/** @inheritDoc * */
|
||||
public function Process($iUnixTimeLimit)
|
||||
{
|
||||
// Garbage temporary objects
|
||||
$this->oTemporaryObjectManager->GarbageExpiredTemporaryObjects();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user