Skip to content

Commit 058d228

Browse files
author
David Hasani
committed
set attempts to 4
1 parent 3805f06 commit 058d228

File tree

1 file changed

+3
-3
lines changed
  • plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq

1 file changed

+3
-3
lines changed

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/RetryableOperation.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ class RetryableOperation<T> {
3030
isRetryable: (Exception) -> Boolean = { it is RetryableException },
3131
errorHandler: (suspend (Exception, Int) -> Nothing),
3232
): T {
33-
while (attempts < MAX_RETRY_ATTEMPTS) {
33+
while (attempts < MAX_ATTEMPTS) {
3434
try {
3535
return operation()
3636
} catch (e: Exception) {
3737
attempts++
38-
if (attempts >= MAX_RETRY_ATTEMPTS || !isRetryable(e)) {
38+
if (attempts >= MAX_ATTEMPTS || !isRetryable(e)) {
3939
errorHandler.invoke(e, attempts)
4040
}
4141
delay(getJitteredDelay())
@@ -48,6 +48,6 @@ class RetryableOperation<T> {
4848
companion object {
4949
private const val INITIAL_DELAY = 100L
5050
private const val MAX_BACKOFF = 10000L
51-
private const val MAX_RETRY_ATTEMPTS = 3
51+
private const val MAX_ATTEMPTS = 4
5252
}
5353
}

0 commit comments

Comments
 (0)