src/Jobs/Maintenance.php
public function cleanup_tables()
    {

        logger()->info('Performing table maintenance');

        // Prune the failed jobs table
        FailedJob::where('id', '<', (FailedJob::max('id') - 100))->delete();

        // Prune the server statuses older than a week.
        ServerStatus::where('created_at', '<', carbon('now')->subWeek(1))->delete();

        // Prune ESI statuses older than a week
        EsiStatus::where('created_at', '<', carbon('now')->subWeek(1))->delete();

        // Remove groups with no users
        Group::doesntHave('users')->delete();
    }
public function cleanup_tables()
    {

        logger()->info('Performing table maintenance');

        // Prune the failed jobs table
        FailedJob::where('id', '<', (FailedJob::max('id') - 100))->delete();

        // Prune the server statuses older than a week.
        ServerStatus::where('created_at', '<', carbon('now')->subWeek(1))->delete();

        // Prune ESI statuses older than a week
        EsiStatus::where('created_at', '<', carbon('now')->subWeek(1))->delete();

        // Remove groups with no users
        Group::doesntHave('users')->delete();
    }
public function cleanup_tables ( ) { logger ( ) -> info ( 'Performing table maintenance' ) ; // Prune the failed jobs table FailedJob :: where ( 'id' , '<' , ( FailedJob :: max ( 'id' ) - 100 ) ) -> delete ( ) ; // Prune the server statuses older than a week. ServerStatus :: where ( 'created_at' , '<' , carbon ( 'now' ) -> subWeek ( 1 ) ) -> delete ( ) ; // Prune ESI statuses older than a week EsiStatus :: where ( 'created_at' , '<' , carbon ( 'now' ) -> subWeek ( 1 ) ) -> delete ( ) ; // Remove groups with no users Group :: doesntHave ( 'users' ) -> delete ( ) ; }
Partially truncates tables that typically contain
a lot of data.
Partially truncates tables that typically contain a lot of data .