Skip to content

Commit

Permalink
Merge pull request #4 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 20f4370 + 53e41f4 commit 958b982
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 958b982

Please sign in to comment.