searchwp\background_process\load_throttle
提供開始日: 4.1.4
SearchWPの負荷監視がCPU負荷のしきい値を超えたことを検出すると、インデックス作成プロセスにタイムアウトが挿入されます。このフックを使用して、そのタイムアウトの期間をカスタマイズできます。
パラメータ
| タイプ | パラメータ | デフォルト | 提供開始 | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 整数 | $throttle |
現在のCPU負荷の2倍 | 4.1.4 |
||||||
| 配列 |
$args
|
4.1.4 |
|||||||
例
All hooks should be added to your custom SearchWP Customizations Plugin.
現在のCPU負荷の4倍のスロットルを使用
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 ); |

