Skip to content

Commit

Permalink
Updates comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmuvi-stripe committed Jun 23, 2023
1 parent 665c11b commit 23e71fe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import kotlin.time.Duration.Companion.seconds
/**
* Polls accounts from backend after authorization session completes.
*
* Will retry upon 202 backend responses every [POLLING_TIME_MS] up to [MAX_TRIES]
* Will retry upon 202 backend responses.
*/
internal class PollAuthorizationSessionAccounts @Inject constructor(
private val repository: FinancialConnectionsAccountsRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import kotlin.time.Duration.Companion.seconds
/**
* Polls OAuth results from backend after user finishes authorization on web browser.
*
* Will retry upon 202 backend responses every [POLLING_TIME_MS] up to [MAX_TRIES]
* Will retry upon 202 backend responses.
*/
internal class PollAuthorizationSessionOAuthResults @Inject constructor(
private val repository: FinancialConnectionsRepository,
Expand All @@ -37,9 +37,4 @@ internal class PollAuthorizationSessionOAuthResults @Inject constructor(
)
}
}

private companion object {
private const val POLLING_TIME_MS = 2000L
private const val MAX_TRIES = 300
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.stripe.android.financialconnections.utils

import com.stripe.android.core.exception.StripeException
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.channelFlow
import kotlinx.coroutines.flow.first
Expand All @@ -13,6 +14,7 @@ import kotlin.time.Duration.Companion.seconds
* If the block execution fails, and [retryCondition] is met, the operation is retried.
* Otherwise the resulting exception will be thrown.
*/
@OptIn(ExperimentalCoroutinesApi::class)
internal suspend fun <T> retryOnException(
options: PollTimingOptions,
retryCondition: suspend (Throwable) -> Boolean,
Expand Down

0 comments on commit 23e71fe

Please sign in to comment.