searchwp\background_process\load_throttle
Da: 4.1.4
Indice
Quando il monitoraggio del carico di SearchWP rileva che la soglia di carico della CPU è stata superata, viene inserito un timeout nel processo di indicizzazione. Puoi usare questo hook per personalizzare la durata di tale timeout.
Parametri
| Tipo | Parametro | Predefinito | Da | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Intero | $throttle |
2 * carico CPU corrente | 4.1.4 |
||||||
| Array |
$args
|
4.1.4 |
|||||||
Esempi
All hooks should be added to your custom SearchWP Customizations Plugin.
Usa un throttle pari a 4 volte il carico CPU corrente
This file contains hidden or 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 ); |

