SearchWP

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
Key Type Value
load Float Current CPU load
4.1.4

Examples

All hooks should be added to your custom SearchWP Customizations Plugin.

Use throttle that is 4 times current CPU load

<?php
// Customize SearchWP's Indexer throttle.
add_filter( 'searchwp\background_process\load_throttle', function( $throttle, $args ) {
return 4 * $args['load'];
}, 10, 2 );

How to use this code