Skip to content
Merged
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions php/WP_CLI/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -2716,14 +2716,20 @@ private function auto_check_update(): void {
$cache->write( $cache_key, (string) time() );

// Check whether any updates are available.
ob_start();
WP_CLI::run_command(
[ 'cli', 'check-update' ],
// Use exit_error => false so that any HTTP/network errors do not fail the user's command.
$result = WP_CLI::runcommand(
'cli check-update --format=count',
[
'format' => 'count',
'launch' => false,
Comment thread
swissspidy marked this conversation as resolved.
Resolved
'exit_error' => false,
'return' => 'all',
]
);
$count = ob_get_clean();
if ( ! is_object( $result ) || $result->return_code ) {
Comment thread
swissspidy marked this conversation as resolved.
Resolved
WP_CLI::debug( 'Background update check failed: ' . ( is_object( $result ) ? $result->stderr : '' ), 'auto-update' );
return;
}
$count = $result->stdout;
if ( ! $count ) {
return;
}
Expand Down
Loading