Make WordPress Core


Ignore:
Timestamp:
01/06/2016 12:23:15 PM (9 years ago)
Author:
dd32
Message:

Background Updates: Remove the 7am/7pm background update check.

This changeset is a more basic version of [36180], clearing the extra now redundant schedule.
As the functionality for this was introduced in 3.9, [28129] has been backported to 3.7/3.8, allowing the API TTL to be respected by those versions.

See #27772.
Fixes #35323.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.3/src/wp-includes/update.php

    r32635 r36184  
    646646        wp_schedule_event(time(), 'twicedaily', 'wp_update_themes');
    647647
    648     if ( ! wp_next_scheduled( 'wp_maybe_auto_update' ) && ! defined( 'WP_INSTALLING' ) ) {
    649         // Schedule auto updates for 7 a.m. and 7 p.m. in the timezone of the site.
    650         $next = strtotime( 'today 7am' );
    651         $now = time();
    652         // Find the next instance of 7 a.m. or 7 p.m., but skip it if it is within 3 hours from now.
    653         while ( ( $now + 3 * HOUR_IN_SECONDS ) > $next ) {
    654             $next += 12 * HOUR_IN_SECONDS;
    655         }
    656         $next = $next - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;
    657         // Add a random number of minutes, so we don't have all sites trying to update exactly on the hour
    658         $next = $next + rand( 0, 59 ) * MINUTE_IN_SECONDS;
    659         wp_schedule_event( $next, 'twicedaily', 'wp_maybe_auto_update' );
    660     }
     648    if ( ( wp_next_scheduled( 'wp_maybe_auto_update' ) > ( time() + HOUR_IN_SECONDS ) ) && ! defined('WP_INSTALLING') )
     649        wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
    661650}
    662651
Note: See TracChangeset for help on using the changeset viewer.