WC_Helper_API_Backoff::get_bounds │ private static │ WC 1.0

Backoff bounds for a single request type, in seconds.

Unknown request types fall back to a conservative default.

Method of the class: WC_Helper_API_Backoff{}

No Hooks.

Returns

array{default:int, max:int}.

Usage

$result = WC_Helper_API_Backoff::get_bounds( $request_type ): array;
$request_type(string) (required)
The Helper API request type (e.g. 'update-check').

WC_Helper_API_Backoff::get_bounds() code WC 11.3.0

private static function get_bounds( string $request_type ): array {
	$fallback = array(
		'default' => HOUR_IN_SECONDS,
		'max'     => WEEK_IN_SECONDS,
	);

	return self::get_all_bounds()[ $request_type ] ?? $fallback;
}