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 20f4370 commit 53e41f4
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 @@ -13,12 +13,15 @@

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

public function __construct(
private readonly RequestTransformerInterface $requestTransformer,
private readonly FanCourierLogger $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 53e41f4

Please sign in to comment.