Version 4.7.6
This commit is contained in:
1 parent
8ba7d43898
commit
7b7404e741
1085 files changed
+30590
-7837
No files matched your search
@@ -227,6 +227,8 @@ class _cleanup extends \IPS\Task
|
||||
\IPS\Db::i()->delete( 'core_members_known_devices', array( 'last_seen < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->prune_known_devices . 'D' ) )->getTimestamp() ) );
|
||||
}
|
||||
|
||||
\IPS\Db::i()->delete( 'core_item_member_map', array( 'map_latest_date < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P9M' ) )->getTimestamp() ) );
|
||||
|
||||
/* Delete moved links */
|
||||
if ( \IPS\Settings::i()->topic_redirect_prune )
|
||||
{
|
||||
@@ -304,6 +306,29 @@ class _cleanup extends \IPS\Task
|
||||
/* Delete alerts */
|
||||
\IPS\Db::i()->delete( 'core_alerts', array( 'alert_end > 0 and alert_end < ?', time() ) );
|
||||
|
||||
/* Trigger queue item to prune old PMs with no replies in x days */
|
||||
if( \IPS\Settings::i()->prune_pms )
|
||||
{
|
||||
/* Get count */
|
||||
$rows = new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_message_topics', array( 'mt_last_post_time < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->prune_pms . 'D' ) )->getTimestamp() ) ), '\IPS\core\Messenger\Conversation');
|
||||
|
||||
$count = $rows->count();
|
||||
if( $count > 5 )
|
||||
{
|
||||
/* Queue */
|
||||
\IPS\Task::queue( 'core', 'PrunePms', array(), 2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Loop and delete now */
|
||||
foreach ( $rows as $conversation )
|
||||
{
|
||||
$conversation->delete();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Truncate the output caches table */
|
||||
\IPS\Output\Cache::i()->deleteExpired( TRUE );
|
||||
|
||||
|
||||
Reference in new issue
Block a user