Skip to content

Commit

Permalink
ANS-18103 - timeout for guzzle client
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-falda authored Sep 11, 2024
1 parent 317b181 commit 1d6c874
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 1d6c874

Please sign in to comment.