-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add exponential back off for api verification of purchases
- Loading branch information
Showing
4 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
android/app/src/main/kotlin/net/mullvad/mullvadvpn/constant/PaymentConstant.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package net.mullvad.mullvadvpn.constant | ||
|
||
const val VERIFICATION_MAX_ATTEMPTS = 4 | ||
const val VERIFICATION_INITIAL_BACK_OFF_MILLISECONDS = 3000L | ||
const val VERIFICATION_BACK_OFF_FACTOR = 3L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/LongExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package net.mullvad.mullvadvpn.util | ||
|
||
import kotlin.math.pow | ||
|
||
fun Long.pow(exponent: Int): Long = toDouble().pow(exponent).toLong() |