summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2022-04-16 09:26:15 +0200
committerAndrej Mihajlov <and@mullvad.net>2022-04-29 10:30:26 +0200
commit50f9ec7fce883df3cc76f8cbf011b62a92d88d38 (patch)
tree69e716c5ef7d2c58691e60174b32f8d37d6bafd1
parentd299161d9f007e568c6b120f9520362f7776f4de (diff)
downloadmullvadvpn-50f9ec7fce883df3cc76f8cbf011b62a92d88d38.tar.xz
mullvadvpn-50f9ec7fce883df3cc76f8cbf011b62a92d88d38.zip
REST: move retry count increment after checking for max retry attempt
-rw-r--r--ios/MullvadVPN/REST/RESTNetworkOperation.swift6
1 files changed, 3 insertions, 3 deletions
diff --git a/ios/MullvadVPN/REST/RESTNetworkOperation.swift b/ios/MullvadVPN/REST/RESTNetworkOperation.swift
index f2760bcbcf..1d75bfe027 100644
--- a/ios/MullvadVPN/REST/RESTNetworkOperation.swift
+++ b/ios/MullvadVPN/REST/RESTNetworkOperation.swift
@@ -135,9 +135,6 @@ extension REST {
return
}
- // Increment retry count
- retryCount += 1
-
// Check if retry count is not exceeded.
guard retryCount < retryStrategy.maxRetryCount else {
logger.debug("Ran out of retry attempts (\(retryStrategy.maxRetryCount))", metadata: loggerMetadata)
@@ -146,6 +143,9 @@ extension REST {
return
}
+ // Increment retry count
+ retryCount += 1
+
// Retry immediatly if retry delay is set to .never
guard retryStrategy.retryDelay != .never else {
sendRequest(endpoint: endpoint, completionHandler: completionHandler)