Making WordPress.org


Ignore:
Timestamp:
03/24/2018 04:44:22 PM (8 years ago)
Author:
iandunn
Message:

Meetup Client: Retry some requests that result in WP_Errors.

Breaking whenever there's a WP_Error would result in some recoverable errors being given up on, like timeouts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/utilities/class-meetup-client.php

    r6920 r6921  
    151151     * Wrapper for `wp_remote_get` to retry requests that fail temporarily for various reasons.
    152152     *
     153     * One common example of a reason a request would fail, but later succeed, is when the first request times out.
     154     *
    153155     * Based on `wcorg_redundant_remote_get`.
    154156     *
     
    182184            $this->maybe_throttle( wp_remote_retrieve_headers( $response ) );
    183185
    184             if ( in_array( $response_code, $breaking_codes, true ) || is_wp_error( $response ) ) {
     186            if ( in_array( $response_code, $breaking_codes, true ) ) {
    185187                break;
    186188            }
Note: See TracChangeset for help on using the changeset viewer.