Automattic\WooCommerce\Internal\BatchProcessing

BatchProcessingController::process_next_batch_for_single_processor()privateWC 1.0

Process a batch for a single processor, and handle any required rescheduling or state cleanup.

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

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->process_next_batch_for_single_processor( $processor_class_name ): void;
$processor_class_name(строка) (обязательный)
Fully qualified class name of the processor.

Код BatchProcessingController::process_next_batch_for_single_processor() WC 8.7.0

private function process_next_batch_for_single_processor( string $processor_class_name ): void {
	if ( ! $this->is_enqueued( $processor_class_name ) ) {
		return;
	}

	$batch_processor = $this->get_processor_instance( $processor_class_name );
	$error           = $this->process_next_batch_for_single_processor_core( $batch_processor );
	$still_pending   = count( $batch_processor->get_next_batch_to_process( 1 ) ) > 0;
	if ( ( $error instanceof \Exception ) ) {
		// The batch processing failed and no items were processed:
		// reschedule the processing with a delay, and also throw the error
		// so Action Scheduler will ignore the rescheduling if this happens repeatedly.
		$this->schedule_batch_processing( $processor_class_name, true );
		throw $error;
	}
	if ( $still_pending ) {
		$this->schedule_batch_processing( $processor_class_name );
	} else {
		$this->dequeue_processor( $processor_class_name );
	}
}