Skip to main content

run_periodic_worker

Function run_periodic_worker 

Source
pub async fn run_periodic_worker(
    config: PeriodicWorkerConfig<'_>,
    body: impl AsyncFnMut() -> Result<()>,
) -> Result<()>
Expand description

Runs body on config.tick_interval forever, logging the still-running line if there is one. A body that returns Err stops the loop and becomes this function’s return value.