Explicitly seal a pending turn without publishing a checkpoint.
(
store: &RedbChangeStore,
session_id: &str,
turn_number: u32,
observed_at: i64,
)
| 405 | |
| 406 | /// Explicitly seal a pending turn without publishing a checkpoint. |
| 407 | pub fn abandon_turn( |
| 408 | store: &RedbChangeStore, |
| 409 | session_id: &str, |
| 410 | turn_number: u32, |
| 411 | observed_at: i64, |
| 412 | ) -> Result<Option<StoredProvenanceTurn>, JournalError> { |
| 413 | let Some(turn) = lifecycle_lookup(store, session_id, turn_number)? else { |
| 414 | return Ok(None); |
| 415 | }; |
| 416 | let abandoned = store |
| 417 | .abandon_provenance_turn( |
| 418 | turn.provenance_id, |
| 419 | turn.generation, |
| 420 | StopState { |
| 421 | cause: StopCause::Abandoned, |
| 422 | observed_at, |
| 423 | last_event_seq: None, |
| 424 | resumable: false, |
| 425 | }, |
| 426 | ) |
| 427 | .map_err(|error| JournalError::store(ErrorCode::ProvenanceLifecycle, error))?; |
| 428 | Ok(Some(abandoned)) |
| 429 | } |
| 430 | |
| 431 | /// Turn status (the read side of the lifecycle). |
| 432 | pub fn get_turn( |
no test coverage detected