Making WordPress.org

Changeset 3288


Ignore:
Timestamp:
06/01/2016 10:00:11 PM (9 years ago)
Author:
iandunn
Message:

WordCamp QBO Client: Bump remote request timeout to 10 seconds.

There have been several cases where requests timed out after 5 seconds, even though the remote server received and fully processed them. Because the server sent its response after the timeout, the client handled it as an error, which resulted in duplicate invoices being created in QuickBooks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo-client/wordcamp-qbo-client.php

    r3287 r3288  
    77
    88class WordCamp_QBO_Client {
     9    const REMOTE_REQUEST_TIMEOUT = 10; // seconds
     10
    911    private static $hmac_key;
    1012    private static $api_base;
     
    9597        $request_url = esc_url_raw( self::$api_base . '/classes/' );
    9698        $request_args = array(
     99            'timeout' => self::REMOTE_REQUEST_TIMEOUT,
    97100            'headers' => array(
    98101                'Content-Type' => 'application/json',
     
    242245        $request_url = esc_url_raw( self::$api_base . '/expense/' );
    243246        $request_args = array(
     247            'timeout' => self::REMOTE_REQUEST_TIMEOUT,
    244248            'body' => $body,
    245249            'headers' => array(
     
    357361
    358362        $args = array(
     363            'timeout' => self::REMOTE_REQUEST_TIMEOUT,
    359364            'headers' => array(
    360365                'Authorization' => $oauth_header,
     
    431436
    432437        $args = array(
     438            'timeout' => self::REMOTE_REQUEST_TIMEOUT,
    433439            'headers' => array(
    434440                'Authorization' => self::_get_auth_header( 'get', $request_url, '', $params ),
     
    488494
    489495        $args = array(
     496            'timeout' => self::REMOTE_REQUEST_TIMEOUT,
    490497            'headers' => array(
    491498                'Authorization' => self::_get_auth_header( 'get', $request_url, '', $params ),
Note: See TracChangeset for help on using the changeset viewer.