Queue::process_queue( null|int $batch_size = null )

Processes the next waiting batch of orders to migrate, if there are any.


Parameters

$batch_size

(null|int) (Optional) Batch processing size override.

Default value: null


Top ↑

Source

File: src/Tribe/Migration/Queue.php

	public function process_queue( $batch_size = null ) {
		if ( null === $batch_size ) {
			$batch_size = $this->get_batch_size();
		}

		$current_offset = $this->get_current_offset();

		if ( 'complete' === $current_offset ) {
			$this->clear_scheduled_task();

			return;
		}

		$this->batch_size = (int) $batch_size;

		$processed = $this->process( $current_offset );

		// if no items are processed or not processed clear the task.
		if ( empty( $processed['processed'] ) && empty( $processed['not_processed'] ) ) {
			tribe_update_option( $this->batch_offset_key, 'complete' );

			$this->clear_scheduled_task();

			return;
		}

		$this->update_offset( $processed['not_processed'] );
	}

Top ↑

Changelog

Changelog
Version Description
4.12.0 Introduced.