diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2020-05-13 12:41:31 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2020-05-13 13:52:29 +0200 |
| commit | 58e7a4dd41ef2f7e5ad162eba99cb469fa0415bc (patch) | |
| tree | e0d19d6350ac2cf08d697fdc041f943b8943ea75 /ios | |
| parent | 54fffbef5cdeece414f26f35c18ecd47821bc038 (diff) | |
| download | mullvadvpn-58e7a4dd41ef2f7e5ad162eba99cb469fa0415bc.tar.xz mullvadvpn-58e7a4dd41ef2f7e5ad162eba99cb469fa0415bc.zip | |
Fix constant names
Diffstat (limited to 'ios')
| -rw-r--r-- | ios/MullvadVPN/AutomaticKeyRotationManager.swift | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ios/MullvadVPN/AutomaticKeyRotationManager.swift b/ios/MullvadVPN/AutomaticKeyRotationManager.swift index ee7cc6e4c7..f9f2daf0b0 100644 --- a/ios/MullvadVPN/AutomaticKeyRotationManager.swift +++ b/ios/MullvadVPN/AutomaticKeyRotationManager.swift @@ -11,10 +11,10 @@ import Foundation import os /// A private key rotation retry interval on failure (in seconds) -private let retryIntervalOnFailure = 300 +private let kRetryIntervalOnFailure = 300 /// A private key rotation interval (in days) -private let rotationInterval = 1 +private let kRotationInterval = 1 class AutomaticKeyRotationManager { @@ -111,9 +111,9 @@ class AutomaticKeyRotationManager { os_log(.error, log: tunnelProviderLog, "Failed to rotate the private key: %{public}s. Retry in %d seconds.", error.localizedDescription, - retryIntervalOnFailure) + kRetryIntervalOnFailure) - self.scheduleRetry(deadline: .now() + .seconds(retryIntervalOnFailure)) + self.scheduleRetry(deadline: .now() + .seconds(kRetryIntervalOnFailure)) } }) { [weak self] (keyRotationEvent) in guard let self = self else { return } @@ -135,7 +135,7 @@ class AutomaticKeyRotationManager { os_log(.error, log: tunnelProviderLog, "Failed to compute the next private rotation date. Retry in %d seconds.") - self.scheduleRetry(deadline: .now() + .seconds(retryIntervalOnFailure)) + self.scheduleRetry(deadline: .now() + .seconds(kRetryIntervalOnFailure)) } } } @@ -211,7 +211,7 @@ class AutomaticKeyRotationManager { } class func nextRotation(creationDate: Date) -> Date? { - return Calendar.current.date(byAdding: .day, value: rotationInterval, to: creationDate) + return Calendar.current.date(byAdding: .day, value: kRotationInterval, to: creationDate) } class func shouldRotateKey(creationDate: Date) -> Bool { |
