<divclass="main-content"id="content"pageIds="kdocs::dev.inmo.krontab//doOnce/dev.inmo.krontab.KronScheduler#kotlin.coroutines.SuspendFunction1[[Error type: Unresolved type for DateTime],TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration//788909594">
<divclass="content sourceset-depenent-content"data-active=""data-togglable=":dokkaHtml/commonMain"><divclass="symbol monospace"><spanclass="token keyword">inline suspend </span><spanclass="token keyword">fun </span><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="do-once.html">T</a><spanclass="token operator">></span><ahref="-kron-scheduler/index.html">KronScheduler</a><spanclass="token punctuation">.</span><ahref="do-once.html"><spanclass="token function">doOnce</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter "><spanclass="token keyword">noinline </span>block<spanclass="token operator">: </span><spanclass="token keyword">suspend </span><spanclass="token punctuation">(</span><spanclass="token keyword"></span><spandata-unresolved-link="/&lt;Error class: unknown class&gt;///PointingToDeclaration/"><Error class: unknown class></span><spanclass="token punctuation">)</span><spanclass="token operator"> -></span><spanclass="token keyword"></span><ahref="do-once.html">T</a></span></span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="do-once.html">T</a><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">Execute <ahref="do-once.html">block</a> once at the <ahref="-kron-scheduler/next.html">KronScheduler.next</a> time and return result of <ahref="do-once.html">block</a> calculation.</p><pclass="paragraph">WARNING!!! If you want to launch it in parallel, you must do this explicitly.</p><pclass="paragraph">WARNING!!! In case if <ahref="-kron-scheduler/next.html">KronScheduler.next</a> of <spandata-unresolved-link="dev.inmo.krontab//&lt;this&gt;/#/PointingToCallableParameters(-1)/">this</span> instance will return null, <ahref="do-once.html">block</a> will be called immediately</p><br><divclass="symbol monospace"><spanclass="token keyword">inline suspend </span><spanclass="token keyword">fun </span><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="do-once.html">T</a><spanclass="token operator">></span><ahref="do-once.html"><spanclass="token function">doOnce</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">scheduleConfig<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><spanclass="token punctuation">, </span></span><spanclass="parameter "><spanclass="token keyword">noinline </span>block<spanclass="token operator">: </span><spanclass="token keyword">suspend </span><spanclass="token punctuation">(</span><spanclass="token keyword"></span><spandata-unresolved-link="/&lt;Error class: unknown class&gt;///PointingToDeclaration/"><Error class: unknown class></span><spanclass="token punctuation">)</span><spanclass="token operator"> -></span><spanclass="token keyword"></span><ahref="do-once.html">T</a></span></span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="do-once.html">T</a><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">Will <ahref="build-schedule.html">buildSchedule</a> using <ahref="do-once.html">scheduleConfig</a> and call <ahref="do-once.html">doOnce</a> on it</p><h2class="">See also</h2><divdata-togglable="See also"><divclass="table"data-togglable="See also"><divclass="table-row"data-filterable-current=":dokkaHtml/commonMain"data-filterable-set=":dokkaHtml/commonMain"><divclass="main-subrow keyValue WithExtraAttributes"><divclass=""><spanclass="inline-flex"><div><ahref="build-schedule.html"><span>build</span><wbr></wbr><span><span>Schedule</span></sp