Available since: 1.0
searchwp_indexer_max_attempts
View Parameters »SearchWP’s indexer tries to run as fast as it can. In some environments (depending on configuration) the indexer may be faced with an issue known as INSERT Deadlock
. This means that the database tables are locked when SearchWP is attempting to index a post. SearchWP will attempt to wait out the deadlock by default 5 times, pausing for a second between each attempt. If you would like to adjust how many retries the indexer executes during an INSERT Deadlock
, you can use this hook like so:
This file contains 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 | |
// only try to recover from INSERT Deadlock 3 times | |
function my_searchwp_indexer_max_attempts( $number_of_attempts ) { | |
return 3; | |
} | |
add_filter( 'searchwp_indexer_max_attempts', 'my_searchwp_indexer_max_attempts' ); |
Parameters
Parameter | Type | Description |
---|---|---|
$number_of_attempts |
Integer |
How many attempts the indexer should make when faced with an INSERT Deadlock |