Skip to content

Commit

Permalink
Merge pull request #206 from klaviyo/as/minor-fix
Browse files Browse the repository at this point in the history
Fixed retry not working
  • Loading branch information
ajaysubra authored Sep 24, 2024
2 parents 1d2a3da + b51f84c commit 8807390
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/KlaviyoCore/Networking/KlaviyoAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public struct KlaviyoAPI {
return .failure(.missingOrInvalidResponse(response))
}

if httpResponse.statusCode == 429, httpResponse.statusCode == 503 {
if httpResponse.statusCode == 429 || httpResponse.statusCode == 503 {
let exponentialBackOff = Int(pow(2.0, Double(attemptNumber)))
var nextBackoff: Int = exponentialBackOff
if let retryAfter = httpResponse.value(forHTTPHeaderField: "Retry-After") {
Expand Down

0 comments on commit 8807390

Please sign in to comment.