Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories

Synchronize::start │ public │ WC 1.0

Starts the synchronization process.

Method of the class: Synchronize{}

No Hooks.

Returns

bool.

Usage

$Synchronize = new Synchronize();
$Synchronize->start(): bool;

Synchronize::start() code WC 11.1.2

public function start(): bool {
	if ( $this->has_scheduled_task() ) {
		wc_get_logger()->log( 'warning', __( 'Synchronization of approved product download directories is already in progress.', 'woocommerce' ) );
		return false;
	}

	delete_option( self::SYNC_TASK_CANCELLED );
	update_option( self::SYNC_TASK_PAGE, 1 );
	$this->queue->schedule_single( time(), self::SYNC_TASK, array(), self::SYNC_TASK_GROUP );
	wc_get_logger()->log( 'info', __( 'Approved Download Directories sync: new scan scheduled.', 'woocommerce' ) );
	return true;
}