Expand description
The loop both credit registration workers run.
The processes differ only in which phases they own and how often they look, so the scheduling lives here instead of in each of them.
Constantsยง
- STILL_
RUNNING_ ๐MESSAGE_ TICKS - Ten minutes of ticks. The per-phase heartbeat in the database is the machine-readable half.
- TICK_
INTERVAL_ ๐SECS - How often the loop looks for a due phase; each phaseโs own interval lives in
credit_registration_phase_state.
Functionsยง
- is_due ๐
- A phase is due when an admin asked for it, or when its interval has elapsed since it last began.
- log_
failure ๐ - phase_
states ๐ - Every phaseโs state in one read, so a tick costs one query rather than one per owned phase.
- run
- Runs the phases this process owns until it is stopped, matching
process_nameagainstCreditRegistrationPhase::process_name. - run_
due_ ๐phase - Runs one due phase, and schedules the next run.