ActionScheduler_Abstract_QueueRunner::schedule_next_instance()protectedWC 1.0

Schedule the next instance of the action if necessary.

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

Возвращает

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

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->schedule_next_instance( $action, $action_id );
$action(ActionScheduler_Action) (обязательный)
-
$action_id(int) (обязательный)
-

Код ActionScheduler_Abstract_QueueRunner::schedule_next_instance() WC 8.9.3

protected function schedule_next_instance( ActionScheduler_Action $action, $action_id ) {
	// If a recurring action has been consistently failing, we may wish to stop rescheduling it.
	if (
		ActionScheduler_Store::STATUS_FAILED === $this->store->get_status( $action_id )
		&& $this->recurring_action_is_consistently_failing( $action, $action_id )
	) {
		ActionScheduler_Logger::instance()->log(
			$action_id,
			__( 'This action appears to be consistently failing. A new instance will not be scheduled.', 'woocommerce' )
		);

		return;
	}

	try {
		ActionScheduler::factory()->repeat( $action );
	} catch ( Exception $e ) {
		do_action( 'action_scheduler_failed_to_schedule_next_instance', $action_id, $e, $action );
	}
}