Yoast\WP\SEO\MyYoast_Client\Infrastructure\Registration
Client_Registration::get_retry_after_seconds
Extracts the Retry-After value (in seconds) from a 429 response, if any.
Метод класса: Client_Registration{}
Хуков нет.
Возвращает
int|null. Seconds until retry, or null when absent or unparseable.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_retry_after_seconds( $result ): ?int;
- $result(HTTP_Response) (обязательный)
- The 429 response.
Код Client_Registration::get_retry_after_seconds() Client Registration::get retry after seconds Yoast 28.3
private function get_retry_after_seconds( HTTP_Response $result ): ?int {
$headers = $result->get_headers();
return Rate_Limited_Exception::parse_retry_after( ( $headers['retry-after'] ?? null ) );
}