searchwp\background_process\load_throttle
Depuis : 4.1.4
Table des matières
Lorsque la surveillance de la charge de SearchWP détecte que le seuil de charge CPU a été franchi, un délai d'attente est injecté dans le processus d'indexation. Vous pouvez utiliser ce hook pour personnaliser la durée de ce délai d'attente.
Paramètres
| Type | Paramètre | Défaut | Depuis | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Entier | $throttle |
2 * charge CPU actuelle | 4.1.4 |
||||||
| Tableau |
$args
|
4.1.4 |
|||||||
Exemples
All hooks should be added to your custom SearchWP Customizations Plugin.
Utiliser une charge 4 fois supérieure à la charge CPU actuelle
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 ); |

