MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / resume_turn

Function resume_turn

libatomic/src/daemon/provenance_core.rs:391–404  ·  view source on GitHub ↗

Resume a stopped turn with a new fencing generation and the same ID.

(
    store: &RedbChangeStore,
    session_id: &str,
    turn_number: u32,
    now: i64,
)

Source from the content-addressed store, hash-verified

389
390/// Resume a stopped turn with a new fencing generation and the same ID.
391pub 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.
407pub fn abandon_turn(

Callers 1

update_turn_implFunction · 0.85

Calls 3

lifecycle_lookupFunction · 0.85
storeFunction · 0.85

Tested by

no test coverage detected