From 53e41f48d1f46153d7905b7c1691f79da3a96314 Mon Sep 17 00:00:00 2001 From: Lukasz Falda <55883656+lukasz-falda@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:38:45 +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 ea70ceb..ea1cac1 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -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