WC_Webhook::failed_delivery
Track consecutive delivery failures and automatically disable the webhook. if more than 5 consecutive failures occur. A failure is defined as a. non-2xx response.
Метод класса: WC_Webhook{}
Хуки из метода
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->failed_delivery();
Список изменений
| С версии 2.2.0 | Введена. |
Код WC_Webhook::failed_delivery() WC Webhook::failed delivery WC 10.5.2
private function failed_delivery() {
$failures = $this->get_failure_count();
if ( $failures > apply_filters( 'woocommerce_max_webhook_delivery_failures', 5 ) ) {
$this->set_status( 'disabled' );
do_action( 'woocommerce_webhook_disabled_due_delivery_failures', $this->get_id() );
} else {
$this->set_failure_count( ++$failures );
}
if ( 0 !== $this->get_id() ) {
$this->save();
}
}