Automattic\WooCommerce\Internal\DataStores\Orders
DataSynchronizer::schedule_background_sync
Schedule an event to run background sync when the mode is set to interval.
Method of the class: DataSynchronizer{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->schedule_background_sync();
DataSynchronizer::schedule_background_sync() DataSynchronizer::schedule background sync code WC 10.8.1
private function schedule_background_sync() {
$interval = $this->get_background_sync_interval();
// Calling Action Scheduler directly because WC_Action_Queue doesn't support the unique parameter yet.
as_schedule_recurring_action(
time() + $interval,
$interval,
self::BACKGROUND_SYNC_EVENT_HOOK,
array(),
'',
true
);
}