Skip to main content

Module periodic_worker

Module periodic_worker 

Source
Expand description

The tick-interval scaffold shared by every background worker that polls the database on a fixed period: regrader, chatbot_syncer and the credit registration phase runners.

Structs§

PeriodicWorkerConfig
How a worker’s ticking loop should behave, so the loop itself carries none of that per-worker detail.
StillRunningLog
The “still running” heartbeat line a worker logs every every ticks.

Functions§

run_periodic_worker
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.
run_periodic_worker_until
run_periodic_worker that returns Ok once shutdown is cancelled. An iteration already running is left to finish; only the wait for the next tick is cut short.