<divclass="content sourceset-depenent-content"data-active=""data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><divclass="symbol monospace"><spanclass="token keyword">inline </span><spanclass="token keyword">fun </span><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="[common]repeat-on-failure.html">R</a><spanclass="token operator">></span><ahref="[common]repeat-on-failure.html"><spanclass="token function">repeatOnFailure</span></a><spanclass="token punctuation">(</span>times<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token punctuation">, </span>onEachFailure<spanclass="token operator">: </span><spanclass="token punctuation">(</span><spanclass="token keyword"></span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html">Throwable</a><spanclass="token punctuation">)</span><spanclass="token operator"> -></span><spanclass="token keyword"></span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><spanclass="token operator"> = </span>{}<spanclass="token punctuation">, </span>action<spanclass="token operator">: </span><spanclass="token punctuation">(</span><spanclass="token keyword"></span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token punctuation">)</span><spanclass="token operator"> -></span><spanclass="token keyword"></span><ahref="[common]repeat-on-failure.html">R</a><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="[common]-optional/index.html">Optional</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="[common]repeat-on-failure.html">R</a><spanclass="token operator">></span><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><pclass="paragraph">Executes the given <ahref="[common]repeat-on-failure.html">action</a> until getting of successful result specified number of <ahref="[common]repeat-on-failure.html">times</a>.</p><pclass="paragraph">A zero-based index of current iteration is passed as a parameter to <ahref="[common]repeat-on-failure.html">action</a>.</p></div></div>