Automattic\WooCommerce\Internal\ProductFeed\Integrations\POSCatalog

AsyncGenerator::reduce_chunk_size_if_stuck │ private │ WC 1.0

Steps the chunk size down when an invalidated status was a stuck in-progress job.

A stuck job was most likely killed because its chunk was too large for the host, so a smaller chunk makes the restart more likely to fit. A genuine failure (state = failed) is a real error rather than a size symptom and is intentionally excluded. Both recovery paths — an ordinary poll ({@see get_status()}) and an explicit rebuild ({@see force_regeneration()}) — call this, so a stuck job adapts the same way however it is recovered.

Метод класса: AsyncGenerator{}

Хуков нет.

Возвращает

void. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->reduce_chunk_size_if_stuck( $status, $option_key ): void;
$status(массив) (обязательный)
The invalidated status being discarded.
$option_key(строка) (обязательный)
The option key for the feed generation status.

Код AsyncGenerator::reduce_chunk_size_if_stuck() WC 11.2.2

private function reduce_chunk_size_if_stuck( array $status, string $option_key ): void {
	if ( self::STATE_IN_PROGRESS === ( $status['state'] ?? '' ) ) {
		$this->reduce_chunk_size( $option_key );
	}
}