Skip to content

Commit

Permalink
Merge pull request #3 from answear/ANS-18103-timeout-for-guzzle-client
Browse files Browse the repository at this point in the history
ANS-18103 - timeout for guzzle client
  • Loading branch information
lukasz-falda authored Sep 12, 2024
2 parents 317b181 + 1d6c874 commit 0187de5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@

class Client
{
private const CONNECTION_TIMEOUT = 10;
private const TIMEOUT = 30;

public function __construct(
private readonly RequestTransformerInterface $requestTransformer,
private readonly BoxNowLogger $logger,
private ?ClientInterface $client = null,
) {
$this->client ??= new GuzzleClient();
$this->client ??= new GuzzleClient(['timeout' => self::TIMEOUT, 'connect_timeout' => self::CONNECTION_TIMEOUT]);
}

public function request(RequestInterface $request): ResponseInterface
Expand Down

0 comments on commit 0187de5

Please sign in to comment.