From 13675609dc9c637b8da4fd533f2c0accd216aecd Mon Sep 17 00:00:00 2001 From: Lukasz Falda <55883656+lukasz-falda@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:40:38 +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 364a226..60e1f28 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -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