From a71cd00cdb7040ef104fea0a1664f72e26f5ad6a Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 14 Nov 2013 04:04:10 +0000 Subject: [PATCH] Background Updates: Spread them over the hour. Props Pento. Fixes #25833 for trunk Built from https://develop.svn.wordpress.org/trunk@26149 git-svn-id: http://core.svn.wordpress.org/trunk@26060 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/upgrade.php | 15 +++++++++++++++ wp-includes/update.php | 2 ++ wp-includes/version.php | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 71a534e628..8a80484570 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -405,6 +405,9 @@ function upgrade_all() { if ( $wp_current_db_version < 25824 ) upgrade_370(); + if ( $wp_current_db_version < 26148 ) + upgrade_372(); + maybe_disable_link_manager(); maybe_disable_automattic_widgets(); @@ -1222,6 +1225,18 @@ function upgrade_370() { wp_clear_scheduled_hook( 'wp_auto_updates_maybe_update' ); } +/** + * Execute changes made in WordPress 3.7.2. + * + * @since 3.7.2 + * @since 3.8.0 + */ +function upgrade_372() { + global $wp_current_db_version; + if ( $wp_current_db_version < 26148 ) + wp_clear_scheduled_hook( 'wp_maybe_auto_update' ); +} + /** * Execute network level changes * diff --git a/wp-includes/update.php b/wp-includes/update.php index a6976c6fbe..82a6366eba 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -584,6 +584,8 @@ function wp_schedule_update_checks() { $next += 12 * HOUR_IN_SECONDS; } $next = $next - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS; + // Add a random number of minutes, so we don't have all sites trying to update exactly on the hour + $next = $next + rand( 0, 59 ) * MINUTE_IN_SECONDS; wp_schedule_event( $next, 'twicedaily', 'wp_maybe_auto_update' ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 44f8e39929..45a0f13576 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -11,7 +11,7 @@ $wp_version = '3.8-alpha-26127'; * * @global int $wp_db_version */ -$wp_db_version = 25824; +$wp_db_version = 26148; /** * Holds the TinyMCE version