searchwp\background_process\load_throttle
Since: 4.1.4
Table of Contents
When SearchWP’s load monitoring detects that the CPU load threshold has been breached, a timeout is injected into the indexing process. You can use this hook to customize the duration of that timeout.
Parameters
Type | Parameter | Default | Since | ||||||
---|---|---|---|---|---|---|---|---|---|
Integer | $throttle |
2 * current CPU load | 4.1.4 |
||||||
Array |
$args
|
4.1.4 |
Examples
All hooks should be added to your custom SearchWP Customizations Plugin.
Use throttle that is 4 times current CPU load
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Customize SearchWP's Indexer throttle. | |
add_filter( 'searchwp\background_process\load_throttle', function( $throttle, $args ) { | |
return 4 * $args['load']; | |
}, 10, 2 ); |