Skip to content

Commit 8b8b857

Browse files
authored
Merge pull request #8 from answear/ANS-18103-timeout-for-guzzle-client
ANS-18103 - timeout for guzzle client
2 parents a7911e6 + 5f68594 commit 8b8b857

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Client/Client.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
class Client
1616
{
17+
private const CONNECTION_TIMEOUT = 10;
18+
private const TIMEOUT = 30;
19+
1720
private ConfigProvider $configuration;
1821
private ClientInterface $client;
1922

@@ -25,6 +28,8 @@ public function __construct(
2528
$this->client = $client ?? new GuzzleClient(
2629
[
2730
'base_uri' => $configuration->getUrl(),
31+
'timeout' => self::TIMEOUT,
32+
'connect_timeout' => self::CONNECTION_TIMEOUT
2833
]
2934
);
3035
}

0 commit comments

Comments
 (0)