Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -30,6 +30,9 @@ class _cleanup extends \IPS\Task
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
/* Delete old failed guest logins for accounts that do not exist */
|
||||
unset( \IPS\Data\Store::i()->failedLogins );
|
||||
|
||||
/* Delete old password / security answer reset requests */
|
||||
\IPS\Db::i()->delete( 'core_validating', array( '( lost_pass=1 OR forgot_security=1 ) AND email_sent < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P1D' ) )->getTimestamp() ) );
|
||||
|
||||
@@ -172,6 +175,13 @@ class _cleanup extends \IPS\Task
|
||||
\IPS\Db::i()->delete( 'core_api_webhook_fires', array( "status='failed' AND time < ?", \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->webhook_logs_fail . 'D' ) )->getTimestamp() ) );
|
||||
}
|
||||
|
||||
/* ...and points log */
|
||||
if( \IPS\Settings::i()->prune_points_log )
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_achievements_log', array( 'datetime < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->prune_points_log . 'D' ) )->getTimestamp() ) );
|
||||
\IPS\Db::i()->delete( 'core_points_log', array( 'datetime < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->prune_points_log . 'D' ) )->getTimestamp() ) );
|
||||
}
|
||||
|
||||
/* Delete old notifications */
|
||||
if ( \IPS\Settings::i()->prune_notifications )
|
||||
{
|
||||
@@ -193,7 +203,10 @@ class _cleanup extends \IPS\Task
|
||||
/* Delete old follows */
|
||||
if ( \IPS\Settings::i()->prune_follows AND !\in_array( 'core_follow', $currentlyPruning ) )
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_follow', array( 'follow_member_id IN(?)', \IPS\Db::i()->select( 'member_id', 'core_members', array( 'last_activity < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->prune_follows . 'D' ) )->getTimestamp() ) ) ) );
|
||||
\IPS\Db::i()->delete( 'core_follow', array( 'follow_app!=? AND follow_area!=? AND follow_member_id IN(?)', 'core', 'member', \IPS\Db::i()->select( 'member_id', 'core_members', array( 'last_activity < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->prune_follows . 'D' ) )->getTimestamp() ) ) ) );
|
||||
|
||||
/* And clear the cache so it can rebuild */
|
||||
\IPS\Db::i()->delete( 'core_follow_count_cache' );
|
||||
}
|
||||
|
||||
/* Delete old item markers */
|
||||
@@ -284,9 +297,23 @@ class _cleanup extends \IPS\Task
|
||||
/* Delete old core follow caches */
|
||||
\IPS\Db::i()->delete( 'core_follow_count_cache', array( 'added < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P30D' ) )->getTimestamp() ) );
|
||||
|
||||
/* Delete old core statistic caches */
|
||||
\IPS\Db::i()->delete( 'core_item_statistics_cache', array( 'cache_added < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P1D' ) )->getTimestamp() ) );
|
||||
|
||||
/* Truncate the output caches table */
|
||||
\IPS\Output\Cache::i()->deleteExpired( TRUE );
|
||||
|
||||
/* Turn on things for cloud 2 */
|
||||
if ( \IPS\CIC2 AND \IPS\Cicloud\getForcedArchiving() )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'archive' ) );
|
||||
|
||||
/* 12 years is the cutoff if archiving is forced, so if it's over 12 years, drop the value down */
|
||||
if( \IPS\Settings::i()->archive_last_post_cloud > 12 )
|
||||
{
|
||||
\IPS\Settings::i()->changeValues( array( 'archive_last_post_cloud' => 12 ) );
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user