From 8821a5531c4b2cd96ae6c1b520ed0b7e3d681225 Mon Sep 17 00:00:00 2001 From: "Drew Jaynes (DrewAPicture)" Date: Thu, 29 Jan 2015 11:52:55 +0000 Subject: [PATCH] Avoid confusion by clarifying an inline comment on logic for performing multisite upgrades. Props dmchale for the initial patch. Fixes #30837. git-svn-id: https://develop.svn.wordpress.org/trunk@31297 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/admin.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/admin.php b/src/wp-admin/admin.php index 1040995f1b..22813cc74f 100644 --- a/src/wp-admin/admin.php +++ b/src/wp-admin/admin.php @@ -63,7 +63,11 @@ if ( get_option('db_upgraded') ) { */ } elseif ( apply_filters( 'do_mu_upgrade', true ) ) { $c = get_blog_count(); - // If 50 or fewer sites, run every time. Else, run "about ten percent" of the time. Shh, don't check that math. + + /* + * If there are 50 or fewer sites, run every time. Otherwise, throttle to reduce load: + * attempt to do no more than threshold value, with some +/- allowed. + */ if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int)( $c / 50 ) ) == 1 ) ) { require_once( ABSPATH . WPINC . '/http.php' ); $response = wp_remote_get( admin_url( 'upgrade.php?step=1' ), array( 'timeout' => 120, 'httpversion' => '1.1' ) );