Background Updates: Spread them over the hour. Props Pento. Fixes #25833 for trunk

git-svn-id: https://develop.svn.wordpress.org/trunk@26149 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2013-11-14 04:03:27 +00:00
parent a23ead1467
commit 6d70a797be
3 changed files with 18 additions and 1 deletions
+2
View File
@@ -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' );
}
}