Expand description
When enrolment discovery lists each course code’s roster.
The tier is derived from the modules on the code whenever it is needed, so a course coming back to life is listed at its new rate at once. Only what cannot be derived lives in the table: triggered listings, the per-code failure backoff and the daily trigger count.
Modules§
- testing
- Test-mode setup the system tests drive through the mock Suotar control routes.
Structs§
- Failing
Roster Code - Codes listed on their own that keep failing, for the admin alert.
- Roster
Schedule - One code’s schedule with the facts its tier comes from.
- Roster
Tier Facts - What the tier of a code is decided from.
Enums§
- Roster
Tier - How often a code is listed without a trigger.
- Schedule
Selection - Which codes
get_schedulesreads.
Constants§
- ACTIVE_
INTERVAL_ SECS - ACTIVE_
WINDOW_ SECS - Completions this recent keep a code on the active tier.
- ALONE_
FAILURE_ 🔒BACKOFF_ SECS - How long a code that failed on its own is left alone, by how many times in a row it has.
- DAY_
SECS 🔒 - DORMANT_
AFTER_ SECS - With no completions for this long a code drops to weekly with account linking on, and stops being listed at all with it off.
- DORMANT_
INTERVAL_ SECS - HOUR_
SECS 🔒 - IDLE_
INTERVAL_ SECS - MAX_
TRIGGERED_ FETCHES_ PER_ DAY - TRIGGER_
MIN_ GAP_ SECS - A triggered listing waits this long after the last one: Suotar’s copy of Sisu is about an hour old, so listing sooner would show nothing new.
- VISIT_
FOLLOW_ UP_ SECS - The one extra listing a visit books, for an enrolment the triggered one was too early to see.
Functions§
- book_
triggered_ fetch - Books a listing for an unlinked student’s visit or check request, with account linking on: at the earliest an hour after the last listing, and for a visit also one follow-up two hours on. Refused once the code has had its triggered listings for the day. Returns whether anything was booked.
- ensure_
rows - Creates the schedule rows of every listable code, and the per-module configuration rows the
discovery counters are written to.
course_idnarrows it to one course. - get_
failing_ codes - The codes whose latest listings failed, most consecutive failures first.
- get_
modules_ by_ code - The active modules on each of
course_codes, which share its roster.course_idnarrows them to one course, as it does forget_schedules. - get_
schedules - Every listable code that has a schedule row; see
ensure_rows.course_idnarrows the codes and the modules their facts come from to one course, for a scoped tick. - mark_
alone_ failed - Records a listing of the code on its own that failed, and backs the code off: an hour, four hours, then daily.
- mark_
attempted - Stamps the codes a listing request is about to go out for.
- mark_
batch_ failed - Records a request batching several codes that failed as a whole. Each is listed on its own from now on, until it succeeds, so one bad code stops failing the others.
- mark_
fetched - Records a roster that arrived. Clears the failure streak and any trigger that was due, and counts a triggered listing against the day’s cap.
- mark_
window_ closed - Records Suotar saying it holds no realisation of the code: tier listings stop until a new completion arrives on it. Not a failure.
- roster_
tier - How often a code’s roster is listed, from how recently it had a completion.