From d99a01ebc1fc4040ec40ee47e8adafb88de4a789 Mon Sep 17 00:00:00 2001 From: Lukasz Falda Date: Mon, 4 Dec 2023 11:36:58 +0100 Subject: [PATCH] Add request timeout option --- src/Client.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Client.php b/src/Client.php index f440dda..afae5b6 100644 --- a/src/Client.php +++ b/src/Client.php @@ -14,6 +14,8 @@ class Client { + private const REQUEST_TIMEOUT = 10.0; + private Configuration $configuration; private HashGenerator $hashGenerator; private ClientInterface $guzzle; @@ -57,6 +59,7 @@ private function request(string $endpoint, Request\Request $request): array 'POST', sprintf('%s/%s', $this->configuration->getUrl(), $endpoint), [ + RequestOptions::TIMEOUT => self::REQUEST_TIMEOUT, RequestOptions::JSON => \array_merge($auth, $request->toArray()), ] );