Skip to content

Commit

Permalink
Merge pull request #9 from answear/ANS-18103-timeout-for-guzzle-client
Browse files Browse the repository at this point in the history
ANS-18103 - timeout for guzzle client
  • Loading branch information
lukasz-falda authored Sep 12, 2024
2 parents 4b2bd0b + ee711a1 commit dd22f07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/PayPo/Service/PayPoClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

class PayPoClient
{
private const CONNECTION_TIMEOUT = 10;
private const TIMEOUT = 30;

private ?\GuzzleHttp\ClientInterface $client;
private ?Authorization $authorizationService;

Expand Down Expand Up @@ -66,7 +69,7 @@ private function sendData(RequestInterface $request, ?string $body): ResponseInt
private function getClient(): \GuzzleHttp\ClientInterface
{
if (null === $this->client) {
$this->client = new \GuzzleHttp\Client();
$this->client = new \GuzzleHttp\Client(['timeout' => self::TIMEOUT, 'connect_timeout' => self::CONNECTION_TIMEOUT]);
}

return $this->client;
Expand Down

0 comments on commit dd22f07

Please sign in to comment.