Changeset 10081
- Timestamp:
- 07/20/2020 05:24:45 AM (4 years ago)
- 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 235 235 236 236 // 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. 238 238 // 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 239 241 $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, ) ) { 241 243 $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 requestand, 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. 244 246 $do_fresh_request = $this->error_volume_is_low(); 245 247 }
Note: See TracChangeset
for help on using the changeset viewer.