Skip to main content

check_write_not_halted

Function check_write_not_halted 

Source
pub(crate) fn check_write_not_halted(state: &AppState) -> Result<(), ApiError>
Expand description

The shared gate on every com.atproto.repo.* write.

Two independent refusals, in a fixed order. The e-stop goes first because Halted is the answer callers already switch on and it names whose stop it is; the lifecycle follows, and ServerNotReady means something only this server knows — that nobody is currently answerable for it, so it accepts no new data. A lapsed operator claim trips both, and the caller hears Halted naming the missing record.

ServerPolicy::accepts_record_writes is the axis the whole lifecycle turns on. An unclaimed server keeps every read this one serves and accumulates nothing new; see didbot_pds::server_state.