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