Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories

Synchronize::start()publicWC 1.0

Starts the synchronization process.

Method of the class: Synchronize{}

No Hooks.

Return

true|false.

Usage

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

Synchronize::start() code WC 8.6.1

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

	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;
}