Exit execution when retry limit reached

This commit is contained in:
Honza 2023-09-12 19:27:20 +02:00
parent d775421f5a
commit 11b031a6af
1 changed files with 1 additions and 0 deletions

View File

@ -68,6 +68,7 @@ suspend inline fun retryUpToAndContinue(
failedAttempts++
if (failedAttempts == retries) {
exceptionWrapper(t)
return
}
val duration = (initialDelayMillis.toDouble() * 2.0.pow(failedAttempts.toDouble() - 1)).toLong()
Twig.warn(t) { "Retrying ($failedAttempts/$retries) in ${duration}s..." }