Expand description
Files uploaded through the exercise-service upload route, which is how a teacher’s CMS editor and the playground store files.
These are recorded so that abandoned ones can be reclaimed. Nothing else can: the host never
reads a spec blob, so a stored file’s only reference may live inside content the host cannot
parse. The counterpart is crate::exercise_task_spec_files, where an exercise service
declares which files its spec actually names.
Structs§
- Reapable
Upload - An upload the reaper may remove: old enough, and named by no spec anywhere.
- Spec
Upload - The recorded upload for a file, if any.
deletedmarks one the reaper has retired.
Constants§
- REAP_
BATCH_ 🔒LIMIT - Cap on one reaper run’s listing, bounding its object-store fan-out and its runtime under the CronJob deadline. A backlog is worked off over successive runs.
Functions§
- backdate
- Ages a recorded upload, so a test can reach the retention window without waiting a week.
- get_
by_ file_ upload_ id - get_
reapable - Uploads older than seven days that no live spec and no page-history version references, oldest
first, at most
REAP_BATCH_LIMITof them. - insert_
many - Records freshly uploaded files so the reaper can later tell an abandoned one from a file it knows nothing about.
- mark_
reaped - Retires an upload. Idempotent, so a run retrying a failed object delete can call it again.