Skip to content

Commit 668e781

Browse files
committed
Ability to set the http client timeout via config
1 parent 573ce21 commit 668e781

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

config/hubspot.php

+3
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,7 @@
6363
'include_associations' => ['companies', 'contacts', 'deals', 'tickets'],
6464
],
6565

66+
'http' => [
67+
'timeout' => env('HUBSPOT_HTTP_TIMEOUT', 10),
68+
],
6669
];

src/Api/Client.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public function prefix($uri): string
3131

3232
public function http(): PendingRequest
3333
{
34-
return Http::withToken($this->accessToken)
34+
return Http::timeout(config('hubspot.http.timeout', 10))
35+
->withToken($this->accessToken)
3536
->throw(function (Response $response, RequestException $exception) {
3637
if ($response->json('category') === 'RATE_LIMITS') {
3738
throw new RateLimitException($response, $exception);

0 commit comments

Comments
 (0)