Skip to main content

Module tasks

Module tasks 

Source
Expand description

In-memory background-task tracker for the Synapse admin API.

Long-running admin actions (room deletion, history purge, bulk redaction) run detached on the runtime and are polled by their id or by the resource they act on. State is process-local: a restart drops history where Synapse persists it for seven days, which consumers tolerate (they poll right after issuing, and a post-restart miss reads as Synapse’s post-retention 404).

Structs§

Service
Task 🔒
TaskInfo
A tracked task’s public snapshot, cloned out from under the lock.

Enums§

Status

Constants§

CAPACITY 🔒
Cap on retained terminal tasks; the oldest are pruned once it is exceeded.
GC_INTERVAL 🔒
Interval between worker garbage-collection sweeps.
RETENTION_MS 🔒
Terminal tasks older than this (seven days) are pruned by the worker.
TASK_ID_LEN 🔒
Random task-id length, matching Synapse’s random_string(16).

Functions§

matches_nonterminal 🔒
prune_tasks 🔒
Drop terminal tasks past the retention window, then cap the survivors.

Type Aliases§

TaskId 🔒
A task’s random id: a fixed 16-byte string kept inline.