Resume a stopped turn with a new fencing generation and the same ID.
(
store: &RedbChangeStore,
session_id: &str,
turn_number: u32,
now: i64,
)
| 389 | |
| 390 | /// Resume a stopped turn with a new fencing generation and the same ID. |
| 391 | pub fn resume_turn( |
| 392 | store: &RedbChangeStore, |
| 393 | session_id: &str, |
| 394 | turn_number: u32, |
| 395 | now: i64, |
| 396 | ) -> Result<Option<StoredProvenanceTurn>, JournalError> { |
| 397 | let Some(turn) = lifecycle_lookup(store, session_id, turn_number)? else { |
| 398 | return Ok(None); |
| 399 | }; |
| 400 | let resumed = store |
| 401 | .resume_provenance_turn(turn.provenance_id, turn.generation, now) |
| 402 | .map_err(|error| JournalError::store(ErrorCode::ProvenanceLifecycle, error))?; |
| 403 | Ok(Some(resumed)) |
| 404 | } |
| 405 | |
| 406 | /// Explicitly seal a pending turn without publishing a checkpoint. |
| 407 | pub fn abandon_turn( |
no test coverage detected