Skip to main content

Module sweep

Module sweep 

Source
Expand description

Reclaiming what a client abandoned, with a trail of what went.

Deliberately not in handlers.rs. That file holds async handlers, and audit_e2e::the_async_handlers_record_without_blocking_the_runtime holds it to a rule for exactly that reason: AuditSink::record opens, writes and flushes a file, so calling it from a runtime thread parks a worker that also serves /health and the accept loop. The sweep below is blocking and is meant to be — it runs inside a spawn_blocking body — but a blocking record sitting in the async-handler file would either trip that guard or, worse, force it to be loosened for everything else in there too. Same reasoning that keeps sweep_expired_uploads in fs.rs rather than here.

Functions§

sweep_expired_sessions
Drop sessions idle past ttl, recording a terminal event for each.