Version 4.3.6

This commit is contained in:
Neo committed 2025-12-19 05:49:12 -08:00
1 parent fe1acf984a
commit 1a0c7fd3c2
609 files changed
+14707 -5726

No files matched your search

+6 -10
View File
@@ -37,15 +37,10 @@ class _deletecontent extends \IPS\Task
{
$this->runUntilTimeout( function()
{
$timeago = \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->dellog_retention_period . 'D' ) );
$count = \IPS\Db::i()->select( 'COUNT(*)', 'core_deletion_log', array( "dellog_deleted_date<?", $timeago->getTimestamp() ) )->first();
if ( !$count )
{
return FALSE;
}
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_deletion_log', array( "dellog_deleted_date<?", $timeago->getTimestamp() ) ), 'IPS\core\DeletionLog' ) AS $log )
$timeago = \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->dellog_retention_period . 'D' ) );
$count = 0;
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_deletion_log', array( "dellog_deleted_date<?", $timeago->getTimestamp() ), 'dellog_deleted_date ASC', array( 0, 20 ) ), 'IPS\core\DeletionLog' ) AS $log )
{
try
{
@@ -60,9 +55,10 @@ class _deletecontent extends \IPS\Task
catch( \OutOfRangeException $e ){}
$log->delete();
$count++;
}
return TRUE;
return $count ? TRUE : FALSE;
} );
return NULL;