mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-22 16:23:50 +00:00
Update RepeatOnFailure.kt
This commit is contained in:
parent
527a2a91ac
commit
3a5771a0cc
@ -7,8 +7,8 @@ package dev.inmo.micro_utils.common
|
|||||||
*/
|
*/
|
||||||
inline fun <R> repeatOnFailure(
|
inline fun <R> repeatOnFailure(
|
||||||
times: Int,
|
times: Int,
|
||||||
crossinline onEachFailure: (Throwable) -> Unit = {},
|
onEachFailure: (Throwable) -> Unit = {},
|
||||||
crossinline action: (Int) -> R
|
action: (Int) -> R
|
||||||
): Optional<R> {
|
): Optional<R> {
|
||||||
repeat(times) {
|
repeat(times) {
|
||||||
runCatching {
|
runCatching {
|
||||||
|
Loading…
Reference in New Issue
Block a user