Hi! Where i can find retry function?
# announcements
a
Hi! Where i can find retry function?
k
What retry function?
a
Sorry, i mean something like that:
Copy code
suspend fun <T> retry(times: Int = Int.MAX_VALUE, delayTime: Long = 1000L, block: suspend () -> T): T {
    repeat(times) {
        try {
            return block()
        } catch (e: Throwable) {
            println(e.message)
        }
        delay(delayTime)
    }
    return block()
}
but i dont sure is there anything similar in the standard library