From 1d6c874ae23b937344eadb695c4a85fe40229193 Mon Sep 17 00:00:00 2001 From: Lukasz Falda <55883656+lukasz-falda@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:32:32 +0200 Subject: [PATCH] ANS-18103 - timeout for guzzle client --- src/Client/Client.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Client/Client.php b/src/Client/Client.php index b053ac028f..f597bd629c 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -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