Skip to content

Commit

Permalink
Merge pull request #12 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 c60e436 + 1367560 commit 3d804b9
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,11 +13,14 @@

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

private ClientInterface $client;

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

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

0 comments on commit 3d804b9

Please sign in to comment.