Making WordPress.org

Changeset 10081

Timestamp:
07/20/2020 05:24:45 AM (4 years ago)
Author:
dd32
Message:

Plugin Directory: Search: Increase the number of concurrent unique search requests to 3.

The current limit of 2 is only hit a few times a day, so 3 should result in a few more requests completeing without warnings to WordPress.org

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/libs/site-search/jetpack-search.php

    r8919 r10081  
    235235
    236236        // Use a temporary lock to prevent cache stampedes.
    237         // This will ensure that a maximum of two processes are performing the search, or one when the stale value is still known.
     237        // This will ensure that a maximum e search, or one when the stale value is still known.
    238238        // Other processes will use the stale cached value if it's present, even for a while after the expiration time if a fresh value is still being fetched.
     239
     240
    239241        $do_fresh_request = false;
    240         if ( wp_cache_add( $lock_key, 1, self::CACHE_GROUP, 15 ) ) {
     242        if ( wp_cache_add( $lock_key, 1, self::CACHE_GROUP, ) ) {
    241243            $do_fresh_request = true;
    242         } elseif ( ! $response && 2 === wp_cache_incr( $lock_key, 1, self::CACHE_GROUP ) ) {
    243             // If we don't have cached data, this is the second request and, error volume is low, still perform the request.
     244        } elseif ( ! $response && = wp_cache_incr( $lock_key, 1, self::CACHE_GROUP ) ) {
     245            // If we don't have cached data, and, error volume is low, still perform the request.
    244246            $do_fresh_request = $this->error_volume_is_low();
    245247        }
Note: See TracChangeset for help on using the changeset viewer.