If api.wp.org request blocks, make sure another requests isn't scheduled for 12 hours. see #8347
git-svn-id: http://svn.automattic.com/wordpress/trunk@9901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9ec79a2dc6
commit
f91d22aadb
|
@ -786,6 +786,7 @@ class WP_Http_Streams {
|
||||||
stream_set_timeout($handle, $r['timeout'] );
|
stream_set_timeout($handle, $r['timeout'] );
|
||||||
|
|
||||||
if ( ! $r['blocking'] ) {
|
if ( ! $r['blocking'] ) {
|
||||||
|
stream_set_blocking($handle, 0);
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
return array( 'headers' => array(), 'body' => '', 'response' => array('code', 'message') );
|
return array( 'headers' => array(), 'body' => '', 'response' => array('code', 'message') );
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,10 @@ function wp_version_check() {
|
||||||
)
|
)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Update last_checked for current to prevent multiple blocking requests if request hangs
|
||||||
|
$current->last_checked = time();
|
||||||
|
update_option( 'update_core', $current );
|
||||||
|
|
||||||
if ( method_exists( $wpdb, 'db_version' ) )
|
if ( method_exists( $wpdb, 'db_version' ) )
|
||||||
$mysql_version = preg_replace('/[^0-9.].*/', '', $wpdb->db_version($wpdb->users));
|
$mysql_version = preg_replace('/[^0-9.].*/', '', $wpdb->db_version($wpdb->users));
|
||||||
else
|
else
|
||||||
|
@ -138,6 +142,10 @@ function wp_update_plugins() {
|
||||||
if ( $time_not_changed && !$plugin_changed )
|
if ( $time_not_changed && !$plugin_changed )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Update last_checked for current to prevent multiple blocking requests if request hangs
|
||||||
|
$current->last_checked = time();
|
||||||
|
update_option( 'update_plugins', $current );
|
||||||
|
|
||||||
$to_send->plugins = $plugins;
|
$to_send->plugins = $plugins;
|
||||||
$to_send->active = $active;
|
$to_send->active = $active;
|
||||||
$send = serialize( $to_send );
|
$send = serialize( $to_send );
|
||||||
|
@ -196,11 +204,15 @@ function wp_update_themes( ) {
|
||||||
|
|
||||||
$new_option = '';
|
$new_option = '';
|
||||||
$new_option->last_checked = time( );
|
$new_option->last_checked = time( );
|
||||||
$time_not_changed = isset( $current->last_checked ) && 43200 > ( time( ) - $current->last_checked );
|
$time_not_changed = isset( $current_theme->last_checked ) && 43200 > ( time( ) - $current_theme->last_checked );
|
||||||
|
|
||||||
if( $time_not_changed )
|
if( $time_not_changed )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Update last_checked for current to prevent multiple blocking requests if request hangs
|
||||||
|
$current_theme->last_checked = time();
|
||||||
|
update_option( 'update_themes', $current_theme );
|
||||||
|
|
||||||
$themes = array( );
|
$themes = array( );
|
||||||
$themes['current_theme'] = $current_theme;
|
$themes['current_theme'] = $current_theme;
|
||||||
foreach( (array) $installed_themes as $theme_title => $theme ) {
|
foreach( (array) $installed_themes as $theme_title => $theme ) {
|
||||||
|
|
Loading…
Reference in New Issue