Private GIT

Skip to content
Snippets Groups Projects
Unverified Commit 684eb897 authored by Kevin Duret's avatar Kevin Duret Committed by GitHub
Browse files

fix(syntax): fix syntax error in purge script (#6233)

parent 54909eab
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,24 @@ require_once(realpath(dirname(__FILE__) . "/centreonDB.class.php"));
class CentreonPurgeEngine
{
private $dbCentstorage;
private $tablesToPurge = array(
private $purgeCommentsQuery;
private $purgeDowntimesQuery;
private $tablesToPurge;
/**
*
* Class constructor
*/
public function __construct()
{
$this->purgeCommentsQuery = 'DELETE FROM comments WHERE (deletion_time is not null and deletion_time ' .
'< __RETENTION__) OR (expire_time < __RETENTION__ AND expire_time <> 0)';
$this->purgeDowntimesQuery = 'DELETE FROM downtimes WHERE (actual_end_time is not null and actual_end_time ' .
'< __RETENTION__) OR (deletion_time is not null and deletion_time < __RETENTION__)';
$this->tablesToPurge = array(
'data_bin' => array(
'retention_field' => 'len_storage_mysql',
'retention' => 0,
......@@ -74,24 +91,16 @@ class CentreonPurgeEngine
'retention_field' => 'len_storage_comments',
'retention' => 0,
'is_partitioned' => false,
'custom_query' => 'DELETE FROM comments WHERE (deletion_time is not null and deletion_time ' .
'< __RETENTION__) OR (expire_time < __RETENTION__ AND expire_time <> 0)'
'custom_query' => $this->purgeCommentsQuery
),
'downtimes' => array(
'retention_field' => 'len_storage_downtimes',
'retention' => 0,
'is_partitioned' => false,
'custom_query' => 'DELETE FROM downtimes WHERE (actual_end_time is not null and actual_end_time ' .
'< __RETENTION__) OR (deletion_time is not null and deletion_time < __RETENTION__)'
'custom_query' => $this->purgeDowntimesQuery
),
);
/**
*
* Class constructor
*/
public function __construct()
{
$this->dbCentstorage = new \CentreonDB('centstorage');
$this->readConfig();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment