Automattic\WooCommerce\Internal\BatchProcessing
BatchProcessingController::update_processor_state()
Update the state for a processor after a batch has completed processing.
Метод класса: BatchProcessingController{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
// private - только в коде основоного (родительского) класса $result = $this->update_processor_state( $batch_processor, $time_taken, $last_error ): void;
- $batch_processor(BatchProcessorInterface) (обязательный)
- Batch processor instance.
- $time_taken(float) (обязательный)
- Time take by the batch to complete processing.
- $last_error(\Exception|null)
- Exception object in processing the batch, if there was one.
По умолчанию: null
Код BatchProcessingController::update_processor_state() BatchProcessingController::update processor state WC 7.7.0
private function update_processor_state( BatchProcessorInterface $batch_processor, float $time_taken, \Exception $last_error = null ): void { $current_status = $this->get_process_details( $batch_processor ); $current_status['total_time_spent'] += $time_taken; $current_status['last_error'] = null !== $last_error ? $last_error->getMessage() : null; update_option( $this->get_processor_state_option_name( $batch_processor ), $current_status, false ); }