Skip to:
Content

BuddyPress.org

Changeset 8584


Ignore:
Timestamp:
07/10/2014 07:57:44 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Check for wp_is_large_network() before looping through all blogs in the network, to prevent looping through thousands of sites on large networks. If you have this many sites, you should manage this in a queue or job system. See #5749.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-functions.php

    r8581 r8584  
    7575    $wpdb->query( "DELETE FROM {$bp->blogs->table_name} WHERE 1=1" );
    7676
     77    // Query for all sites in network
    7778    if ( is_multisite() ) {
    78         $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0 AND site_id = %d", $wpdb->siteid ) );
     79
     80        // Get blog ID's if not a large network
     81        if ( ! wp_is_large_network() ) {
     82            $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0 AND site_id = %d", $wpdb->siteid ) );
     83
     84        // Large networks are not currently supported
     85        } else {
     86            $blog_ids = false;
     87        }
     88
     89    // Record a single site
    7990    } else {
    8091        $blog_ids = 1;
Note: See TracChangeset for help on using the changeset viewer.