From f92699be7c8147409649b582a4aa51dc000323b7 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 12 Jul 2024 16:17:16 +0200 Subject: [PATCH] Handle ten second rate limit In the case a lot of email messages are sent and needed to be tracked within HubSpot we receive the following error message "You have reached your ten_secondly_rolling limit.". The retries should split the burst regarding the ten second rate limit. --- src/HubspotEmailChannel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HubspotEmailChannel.php b/src/HubspotEmailChannel.php index 18c9c19..0f07134 100644 --- a/src/HubspotEmailChannel.php +++ b/src/HubspotEmailChannel.php @@ -105,7 +105,7 @@ protected function callApi(string $baseUrl, string $method, array $params = []): $params['hapikey'] = $apiKey; } - $http = Http::acceptJson(); + $http = Http::acceptJson()->retry(3, 11 * 1000); if (is_null($apiKey)) { if (is_null(config('hubspot.access_token'))) {