Skip to main content

Module credit_registration_roster_schedules

Module credit_registration_roster_schedules 

Source
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§

FailingRosterCode
Codes listed on their own that keep failing, for the admin alert.
RosterSchedule
One code’s schedule with the facts its tier comes from.
RosterTierFacts
What the tier of a code is decided from.

Enums§

RosterTier
How often a code is listed without a trigger.
ScheduleSelection
Which codes get_schedules reads.

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_id narrows 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_id narrows them to one course, as it does for get_schedules.
get_schedules
Every listable code that has a schedule row; see ensure_rows. course_id narrows 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.