Skip to content

Commit

Permalink
update response handling for false (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
cykolln authored Dec 13, 2023
1 parent d9193d2 commit bd2d63e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion KlaviyoV3Sdk/KlaviyoV3Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ protected function requestV3($path, $method = null, $body = null, $attempt = 0)
$statusCode = curl_getinfo($curl, $phpVersionHttpCode);
// In the event that the curl_exec fails for whatever reason, it responds with `false`,
// Implementing a timeout and retry mechanism which will attempt the API call 3 times at 5 second intervals
if ($statusCode < 200 || $statusCode >= 300 || $response == false) {
if ($statusCode < 200 || $statusCode >= 300 || $response === false) {
if ($attempt < 3) {
sleep(1);
$this->requestV3($path, $method, $body, $attempt + 1);
Expand Down

0 comments on commit bd2d63e

Please sign in to comment.