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

Method prepare_checkpoint

atomic-cli/src/commands/agent/owner.rs:329–356  ·  view source on GitHub ↗
(
        &self,
        reservation: JournalTurnReservation,
        source: JournalCheckpointSource,
        now: i64,
    )

Source from the content-addressed store, hash-verified

327 }
328
329 fn prepare_checkpoint(
330 &self,
331 reservation: JournalTurnReservation,
332 source: JournalCheckpointSource,
333 now: i64,
334 ) -> Result<JournalCheckpointAttempt, String> {
335 let repository = self.repository.clone();
336 run_outside_async_runtime(move || {
337 let response = request_with_reconnect(
338 &repository,
339 OwnerRequest::PrepareCheckpoint {
340 provenance_id: reservation.provenance_id,
341 expected_generation: reservation.generation,
342 reuse_frozen_changes: source.change_hashes.is_empty(),
343 source: to_store_checkpoint_source(source),
344 now,
345 },
346 )?;
347 match response {
348 OwnerResponse::CheckpointPrepared { attempt } => Ok(to_journal_checkpoint_attempt(
349 reservation.provenance_id,
350 attempt,
351 )),
352 other => Err(unexpected_response("prepare checkpoint", other)),
353 }
354 })
355 .map_err(|error| error.to_string())
356 }
357
358 fn load_frozen_envelopes(
359 &self,

Callers

nothing calls this directly

Calls 7

request_with_reconnectFunction · 0.85
unexpected_responseFunction · 0.85
cloneMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected