Automattic\WooCommerce\Internal\PushNotifications\Services

NotificationProcessor::cancel_safety_net │ private │ WC 10.9.0

Cancels the pending safety net ActionScheduler job for a notification.

Called after the processor handles the notification (whether success or failure with retry scheduled) so the safety net doesn't fire redundantly.

Метод класса: NotificationProcessor{}

Хуков нет.

Возвращает

void. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->cancel_safety_net( $notification ): void;
$notification(Notification) (обязательный)
The notification whose safety net to cancel.

Список изменений

С версии 10.9.0 Введена.

Код NotificationProcessor::cancel_safety_net() WC 11.2.2

private function cancel_safety_net( Notification $notification ): void {
	// Must match the shape PendingNotificationStore::schedule_safety_net() used;
	// both derive the args from Notification::get_safety_net_args() so the
	// exact-equality match Action Scheduler performs succeeds.
	as_unschedule_all_actions(
		self::SAFETY_NET_HOOK,
		$notification->get_safety_net_args(),
		self::ACTION_SCHEDULER_GROUP
	);
}