searchwp\background_process\load_throttle
Desde: 4.1.4
Sumário
Quando o monitoramento de carga do SearchWP detectar que o limite de carga da CPU foi violado, um tempo limite será injetado no processo de indexação. Você pode usar este hook para personalizar a duração desse tempo limite.
Parâmetros
| Tipo | Parâmetro | Padrão | Desde | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Inteiro | $throttle |
2 * carga atual da CPU | 4.1.4 |
||||||
| Array |
$args
|
4.1.4 |
|||||||
Exemplos
All hooks should be added to your custom SearchWP Customizations Plugin.
Use um throttle que seja 4 vezes a carga atual da CPU
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 ); |

